Jump to content

Too many Columns - Urgent


tsaliki

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 15
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 +

+--------+

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

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.

:-)

Link to comment
Share on other sites

  • 3 months later...
  • 7 months later...

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

Link to comment
Share on other sites

  • 1 year later...

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

Link to comment
Share on other sites

  • 2 weeks later...

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

 

Link to comment
Share on other sites

  • 2 months later...

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.

Link to comment
Share on other sites

  • 5 years later...

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.

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