Jump to content
JasperReports 7.0 is now available ×

can I set columnsize?


jackdawson

Recommended Posts

Hi,

 

Can anyone let me know if I can set the column size of a column in a report?

 

What's happening with me is when I have 4 columns in a report, it prints the data till the end of the page and then starts printing in the second column and so on.

 

If there is a way that I can set the column size so that once it prints 6rows in a column it should start printing in the next column, then that would be really great.

 

Any suggestions please.

 

Thanks.

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

hi jackdawson,

 

if the problem is how the space is used, you can ask JasperReports to will the report horizontally insead of vertically, you would get a record filling like:

 

1 | 2 | 3 | 4

5 | 6 | 7 | 8

....

 

Instead of

 

1 | 4 | 7

2 | 5 | 8

3 | 6 |

 

If your problem is really that you want no more than 6 records per column, inspite of how height is your report, you can create a group based of an expression like:

 

new Integer( $V{REPORT_COUNT}.intValue()/6 )

 

This mean: every 6 records, create a new group.

Now, if you set the group to go to a new column, you get what you need.

 

Giulio

Link to comment
Share on other sites

  • 4 months later...

I tried to get the data in columns but I dont know why but this bizarre thing happens:

1.) 1st column has 6 records displayed.
2.) 2nd column has 6 records displayed
3.) 3rd column has only 1 record displayed.
4.) 4th column has 6 records displayed.
5.) the rest of the printing starts in the next page and the remaining 5 records are displayed in each column.

It seems very strange.
Why would 1st, 2nd and 4th columns display 6 records and not the 3rd column?

Thanks again for your help.

Link to comment
Share on other sites

Report structure:
Main report(say, report1) has a subreport(say, report2) which again has 2 subreports(say, report 3 and report 4 respectively). The reports 3 and 4 have queries that fetch the data and fill the report.

I will attach a sample out. Please check that out.


Thanks again for your help.



 

Link to comment
Share on other sites

I dont see my attachment. It's gone. I attached it twice.

This is strange.  Anyways, this is what the attachment should have:

I think my problem has something to do with the page dimensions. So here are the details about them:

Reports Information:
===================

Report            Page Height    Page Width    No. of Cols.     Col. Width
------                     -----------            ----------          ------------    ------------
Main(report1)    842px                 595px                 1                  555   
report2               200px                 580px                 1                  580
report 3              200px                 550px                 4                  135
report 4              200px                 550px                 4                  135


Sample output:
==============

Hour    Count        Hour    Count        Hour    Count       
--------  ---------     ---------    --------        --------  -----------
0    xx         6    xx         12     xx                 13     xx
1    xx         7    xx                                       14     xx
2    xx         8    xx                                       15     xx
3    xx         9    xx                                       16     xx
4    xx         10    xx                                     17      xx   
5    xx         11    xx                                     18     xx

And, the rest of the data is printed on the next page one in each column. This is still more
bizarre.

 

Thanks again.

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