Index

Using JSP to Print a Report

JReport Enterprise Server provides printDemo.jsp, printCustomerlist.jsp and printReport.jsp which enable users to print a report without any view in client.

Configuration

Let us suppose that JReport Enterprise Server and Help are installed to C:\JREntServer. Before you run these JSP files, you should:

  1. Extract printDemo.jsp.zip, printCustomerlist.jsp.zip and printReport.jsp.zip from C:\JREntServer\help\en\srv-material to C:\JREntServer\public_html\jinfonet.
  2. Enable the JSP option. To enable JSP running, please load Administration interface of JREntServer. That is, start JREntServer with option -a:

    C:\JREntServer\bin>JREntServer -a

    Then click Configuration after logging into the server. Go to the Advanced tab, check the Enable JSP box, and then click OK.
  3. Restart JREntServer to apply this change. Then, you can access these JSP files from http://localhost:8888/jinfonet/printDemo.jsp.

Printing a Report

There are three JSPs provided for printing a report:

  1. printDemo.jsp: This JSP provides frames to load printCustomerlist.jsp and printReport.jsp. You could access this JSP file from http://localhost:8888/jinfonet/printDemo.jsp as follow:



    PrintInCurrentFrame
    Set to call printReport.jsp and load applet of JReport Viewer Frame.

    PrintInHiddenFrame
    Set to call printReport.jsp without loading applet of JReport Viewer Frame.

    Reset
    Reset the previous options.

    View
    View this report.
  2. printCustomerlist.jsp: This JSP shows how to set parameters for printing the customerlist report by using the ViewerApplet. This JSP calls printReport.jsp. If you want to print the other reports, you could follow this JSP file as example to write your own JSP. In your own JSP, you should modify "cat" and "rptName" value.

    String cat = "/hsqlDemo/Tutorial.cat"; //request.getParameter(APIConst.TAG_CATALOG);
    String rptName = "customerlist.cls"; //request.getParameter(APIConst.TAG_REPORT);

  3. printReport.jsp: This JSP shows how to print reports by using the ViewerApplet. The example JSP printCustomerlist.jsp calls this JSP.

Parameters

The full list of available parameters is:

Interactive
If checked, you could specify the print setup in the Print dialog.

Background
If checked, the print job will run in the background.

UseJDK11
If checked, you will use instance PrintJob of JDK11 to print the report.

Wait
If checked, you have to wait until the print job is finished.

SeparateLargePage
If checked, the large page will be separated into several pages automatically.

NotifyComplete
This parameter is used with the parameter wait. After the print job is finished, a box will pop up to note you, and you could do any other work instead of keep on waiting.

Printer
Specify the printer to implement the print job.

Index