Too many Columns - Urgent

I have too many columns to display in my report. I want to display few columns in page1 and remaining on page2. Is this possible?

page 1
----------------------------------------------------
| field1 | field2 .......................| field9 |
----------------------------------------------------
| data | data |..........................| data |
----------------------------------------------------
| data | data |..........................| data |
----------------------------------------------------

page2
----------------------------------------------------
| field10 | field11 |......................| fieldn |
----------------------------------------------------
| data | data |............................| data |
----------------------------------------------------
| data | data |............................| data |
----------------------------------------------------

Next set of rows will be displayed on Page 3 and 4 and so on.


Can anyone has a working sample of "Jasper Tip & Tricks – Bands Larger than One Page."


Thanks in advance,
tsaliki
tsaliki's picture
288
Joined: Jan 7 2007 - 1:16pm
Last seen: 16 years 4 months ago

15 Answers:

Can anyone let me know - whether this is possible to make in Jasper?....

Thanks,
Tsaliki
tsaliki's picture
288
Joined: Jan 7 2007 - 1:16pm
Last seen: 16 years 4 months ago
Have you tried crosstab?
slaisne's picture
433
Joined: Nov 16 2006 - 4:11am
Last seen: 2 years 6 months ago
Hi Slaisne,

I think Crosstab is for different purpose - to show vertical data horizontally or similar purpose. am i not?

My requirement is to start the next page with next set of columns after first page.

Any ideas, clues or suggestion are highly helpful....

Regards,
tsaliki
tsaliki's picture
288
Joined: Jan 7 2007 - 1:16pm
Last seen: 16 years 4 months ago
I have a simular problem, and I solve it with a sub-report which describe one column.
Field is in the column header,
Data: in the detail.
The main report just display the subreport.
The main is composed with n colum and an horizontal progress qay.
slaisne's picture
433
Joined: Nov 16 2006 - 4:11am
Last seen: 2 years 6 months ago
Hi Slaisne,

I was trying hard on your point and could not make out any...

I tried to put 1-10 columns in subreport1, 11-20 columns in subreport2. I kept these two subreports in column1 and column2 in main report, and print order is horizontal. Got the error "SubreportÂoverflowedÂonÂaÂbandÂthatÂdoesÂnotÂsupportÂoverflow."

I think, using multiple columns do not help as the main report divided vertically so reducing the width for each subreport.

Can you provide sample jrxmls used to solve your problem?

Thanks,
Vijay
tsaliki's picture
288
Joined: Jan 7 2007 - 1:16pm
Last seen: 16 years 4 months ago
No, you've to design just one sub-report for one column, and to put it in the first column in the main report.
JasperReport duplicate it on the other column.

Main report

+--------+--------+--------+--------+--------+--------+
|+------+| | | | | |
| | | | | | |
|sub report| | | | | |
| | | | | | |
|+------+| | | | | |
+--------+--------+--------+--------+--------+--------+

sub-report

+--------+
+ field +
+--------+
+ data +
+ data +
+ data +
+--------+
slaisne's picture
433
Joined: Nov 16 2006 - 4:11am
Last seen: 2 years 6 months ago
Hi Slaisne,

Thanks for the response.

I am confused... with one subreport... my requirement is to display 1000 database records of 25 columns as follows... each page will display 25 rows


Page1 --> 1-10 columns 1-25 rows
Page2 --> 11-20 columns 1-25 rows
Page3 --> 21-25 columns 1-25 rows
Page4 --> 1-10 columns 26-50 rows
Page5 --> 11-20 columns 26-50 rows
Page6 --> 21-25 columns 26-50 rows
so on...

I think this is NOT feasible with Jasper... what would you say...

Thanks
tsaliki
tsaliki's picture
288
Joined: Jan 7 2007 - 1:16pm
Last seen: 16 years 4 months ago
Hi...

I've exactly the same problem. Is there any solution? or is there any planned functionality, open track, to solve this situation?

Thanks...

Best regards...

David
dmariaa's picture
77
Joined: Oct 22 2006 - 9:16pm
Last seen: 16 years 7 months ago
Hi,

I was almost on the verge of telling you that is not possible, when I got this crazy idea:

Make a report template that has a page width that is N-times wider than the final page width of you document.
This way you could put in any section all the columns that you need.
Then, let JasperReports produce this wide-page document which would have let's say P pages.
When ready, take the resulting JasperPrint object and cut it into pieces like this.
Split each page in N smaller pages by creating JRBasePrintPage objects and copying elements to it from the initial wide page. These new pages could be inserted in the list of pages of the original document resulting in a N*P page long document. On this document you then reduce the page width to what your final document would need to have and ... there you go.

I hope this helps.
Teodor

P.S. If this works, it should increase my karma.
:-)
teodord's picture
46784
Joined: Jun 30 2006 - 9:00am
Last seen: 3 days 14 hours ago
Check out a checklist I have made, if the "subreport overflow error" should appear

http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&f...

If you were not using subreports, nevermind.
Gustaf's picture
273
Joined: Jun 3 2007 - 9:49pm
Last seen: 16 years 6 hours ago
hi there, first post.

in my project i have a subreport in the title band, and about 20 columns in the master detail band.

my requirement is to display the final report using a portrait layout, so the 20 columns would not fit without severely scaling the report in size, or to move to multiple pages.

i'm currently trying to use the baseprintpage idea from this thread (copying the wide master to the individual pages), but i'm stuck with the subreport in the title band. should the fact that the parent object is a subreport be ignored, and when i'm copying it i treat it as a set of columns in the new page?

is there an easier way to handle the splitting of columns to the next page for wide reports?

thanks in advance,
Dan
dbyers's picture
55
Joined: Jan 21 2008 - 10:44am
Last seen: 15 years 4 months ago

teodord
Wrote:

Split each page in N smaller pages by creating JRBasePrintPage objects and copying elements to it from the initial wide page. These new pages could be inserted in the list of pages of the original document resulting in a N*P page long document. On this document you then reduce the page width to what your final document would need to have and ... there you go.

 

I having the same problem... could you explain this part better?

How do I split each page in N smaller pages by using JRBasePrintPage objects?

many thanks,

Marco

bartleboom's picture
Joined: Oct 14 2009 - 3:22am
Last seen: 13 years 7 months ago

Hi,

 

You just need to look into the Javadoc of JasperReports. You'll see that JasperPrint objects are made of pages and on each page there are elements.

You can get elements from one page and add to another.

There is even a sample showing the use of this area of the API under /demo/samples/noreport and /demo/samples/tableofcontents

 

I hope this helps.
Teodor

 

teodord's picture
46784
Joined: Jun 30 2006 - 9:00am
Last seen: 3 days 14 hours ago

Hi Teodor,

I tried this and it worked.

teodord wrote:

Make a report template that has a page width that is N-times wider than the final page width of you document.
This way you could put in any section all the columns that you need.
Then, let JasperReports produce this wide-page document which would have let's say P pages.
When ready, take the resulting JasperPrint object and cut it into pieces like this.
Split each page in N smaller pages by creating JRBasePrintPage objects and copying elements to it from the initial wide page. These new pages could be inserted in the list of pages of the original document resulting in a N*P page long document. On this document you then reduce the page width to what your final document would need to have and ... there you go.

Thank you :-)

I used a wide report template with many columns to produce a JasperPrint with wide pages. I then modified that JasperPrint to have a few columns (which contain row titles and sequence numbers) appear on every page and all other columns (which contain row and column specific data) - each on its corresponding page.

haiku's picture
221
Joined: Aug 13 2009 - 3:05am
Last seen: 13 years 9 months ago

How about creating several detail bands, just right click on the existing detail band and choose 'Add Band' this creates an additional detail band below the first. I suppose you could then add the first N fields to the original detail band then the next N fields to detail band 2 ..etc. Appropriate print when conditions on each band would be needed so they appear once for each records selected.

p.harrison_1's picture
Joined: Jun 30 2014 - 6:28am
Last seen: 1 year 1 month ago
Feedback