> I have an app that creates reports, which are basically HTML. The
> reports need to be printed and that is what I'm trying to figure out.
>
> I'm porting an older app - that is more of traditional web app.
> Reports are displayed in a page - with a UI wrapped around them. When
> a user wants to print a report, he clicks a "print" link, which pops
> up a window with a printer friendly version (no UI elements). He can
> then selects the browser's print command. Works nicely.
>
> I'm trying to figure out how to do that in GWT. I can display a
> report. Printing doesn't work well, because it prints all the UI
> stuff too.
>
> I've looked into separate popup windows. Most of the messages here
> recommend against doing it. Instead they suggest using a Dialog box.
> I've tried it and created a Dialog with simply an HTMLPanel. However,
> selecting File->Print (in the browser) prints the entire page (the
> entire window).
>
> Any suggestions on a way to do this?
Here's one idea I've implemented. It's amenable to arbitrary levels of
complexity.
Your UI posts a request to your server on user action (e.g. a button
click event), and opens the result in a new window:
<button type="submit">
<form action="printTheCurrentReport" _target="_blank" method="get">
<!-- Depending on how you manage sessions, you might want a session ID
token in a hidden field -->
</button>
Reminder: you should have css for print media.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment