Jump to content

Doubt with printing dialog when printing jasper reports


augarte

Recommended Posts

Hi,

I want to display the printing dialog when I print my jasper reports. Until now, I have used two methods for printing my reports:

1) JasperPrintManager: this one is very simple and easy to use. I just call to printReport method and it prints it. It has two parameters (jasperPrint and printDialog) so if I set the second parameter as 'true' it displays the Windows printing dialog (because I'm running Jasper on Windows)

2) JRPrintServiceExporter:This method allows us to specify more configurations for the printer. For example, which is very interesting in my case is that I'm able to specify a JasperPrint List (this is very usefull because in some cases I have more than one JasperPrint object). If I set 'displayPrintDialog' attribute as true, it displays a different dialog (I think it is Java based dialog). In this case also, as you can see in the attached screenshot, the "Properties" button (Propiedades), is disable and I don't know why.

My problem is that I somehow want to combine properties of both methods. What I need is to print a list of JasperPrint objects but with the OS based Printing Dialog and not with the Java based one. So the options I have been checking are the following ones:

  • Using JRPrintServiceExporter, display OS based printing dialog. I couldn't find nothing about that
  • Print a List of JasperPrint objects with JasperPrintManager. What I've been doing is to iterate the JasperPrint list and call to printManager as number of times as JasperPrint objects the list has. The problem is that I want to display the printDialog for the first JasperPrint and keep the configuration the user has choosed for printing the rest of the list. I have tried to do it without sucess.
  • ...

Does anyone know what could I do solve my problem. I guess it is not easy to do what I want but if someone has a solution it'd be really helpfull.

So thanks in advance for your attention.

Kind regards.

Aitor.

P.D: I attach two screenshots with both printing dialogs (OS based and Java based). Just if someone does not understand what I want to say.

Link to comment
Share on other sites

  • 1 year later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...