Jump to content

need report to display multiple static text pages


tman

Recommended Posts

I have read many examples of how to create a report that displays multiple static pages, however, I have not been able to duplicate the process with IReport 1.2.4.

I created a master report, set the When No Data field to AllSectionsNoDetail.

Added static text to the detail section.

I created a Group footer and header section on the Master report, and then added a subreport (a new report with static text in the detail section) to the group footer.

I also set the When No Data field to AllSectionsNoDetail in the subreport.

There is no datasource as the report is a few pages of static text.

 

Compiled and ran the report. The Master page was visible but not the subreport. I then tried moving the static text of the subreprt into another section, the PageHeader section.

Again compiled and ran the report with the same results.

 

Any ideas??

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

I think I'm trying to do the same thing and I'm having the exact same problem.

 

I've tried to do the simplest thing possible. Create a report with some static text in the detail band. Then I created a subreport with some static text in its detail band. It seems to compile fine, but when I execute, only the text from the master report shows up. I've been playing around with the various settings that I've read from previous posts with no luck.

 

Is what I'm trying to do possible?

Link to comment
Share on other sites

My hack,

 

I used a sql connection for each report as the datasource, the master report and the subreport report. The sql query is simply, Select "dummyrecord" from dual.

 

In the master report I created the subreport connection using the same master report connetion. Since each report now queries for 1 record the sub report now displays as well as the master report.

 

If you do not have a sql connection (ie a database to connect to) you could probably do the same thing with a JRDataSource, creating one dummy record in the JRDataSource and using this datasource for the master and subreport.

 

Using this technique you don't have to worry about setting any parameters in the repor, like the "When No Data" parameter.

 

The fact that this simple feature is not built into Jasper reports is disconcerning. This issue has been brought up since at least version .05.

Link to comment
Share on other sites

  • 1 year later...

I  needed to create a multiple pages report (2 in specific case) with lot of static text and all dynamic data passed as parameters. This is the method I used:

So first of all, with iReport  3.0 I created a A4 empty master report "MainReport", the MainReport_subreport0 (1 page), MainReport_subreport1 (2page).

Set the orientation of the reports as needed (horizontal in my case).

Set to 0 (zero) all the margins(upp, botom, left, right)  of the MainReport_subreport0 and the MainReport_subreport1.

Set the titles band height to 591 px and all others bands height to 0 (zero) in the MainReport_subreport0 and the MainReport_subreport1.

Filled with  report elements ( static-text, fields, parameters..) the MainReport_subreport0 and the MainReport_subreport1 as needed.

Added MainReport_subreport0 element to the title band of the MainReport. Set the MainReport_subreport0 element length to 782 px and height to 0 px, Y=2, X=0.

Added MainReport_subreport1 element to the title  band of the MainReport. Set the MainReport_subreport1 element length to 782 px and height to 0 px, Y=5, X=0.

In the MainReport, set the title band height to 7 and all others to 0 (zero).

Pass the parameters to the subreports...

And share your knowledge.

 

Link to comment
Share on other sites

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...