Jump to content

Landscape report problem!!


p_a

Recommended Posts

Hello,

 

I would like to have a landscape report like the one I attached the picture.

 

As I have 2 different queries I use subreport for the second query.But my problem is where should I put that subreport to have the report like the picture I attach?

 

If I put the subreport in detail band of main report for each row of main report my subreport will be run and this is not the thing I want.

 

I would be appreciate anyone who could solve my problem.

 

Thanks,Pegah

 

Post edited by: p_a, at: 2007/05/07 05:34 [file name=LandsacpeReport.jpg size=77206]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/LandsacpeReport.jpg[/file]

Post edited by: p_a, at: 2007/05/07 05:39

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

I made my report as you said but I got a filling report error:

 

Error filling print...

net.sf.jasperreports.engine.JRRuntimeException: Infinite loop creating new page due to column header overflow.

 

:(

 

Do you have any idea about this error?

 

I need to make a landscape report and I would be grateful if you could help me.

Link to comment
Share on other sites

p_a,

 

How's it going?

Try this out.

 

I think the following suggestions and information about subreports and subreport linking would help you (I hope):

 

1. Make the layout of the master report before making your subreport. That will allow you to make the correct measurements for your subreport. This is just a suggestion. It really depends on what you are used to doing or your preference.

 

2. The size of your subreport matters.

The width of the subreport element in your master report does matter. If you make your subreport element shorter than your actual subreport you may not be able to display all the information that is in your subreport. If you make your subreport element longger than your actual subreport, your master report may not look good.

 

3. Check margins and page dimensions on both master and subreport. You must also make sure that your subreport element is within the margins of your master report. This may cause some error or prevent some information from displaying correctly in the generated report.

 

4. Don't place margins on your subreport.

This is also just a suggestion. Subreports usually do not have margins because margins in your subreport will only waste space in your master report. Make your subreport as wide (width) and as tall (height) as you need and set all your subreport margins to zero (0). It will save you space and make your reports better looking.

 

 

LAYOUT:

 

I see that you want your subreport to occupy the left side of your report. The right side of your report will be filled using your master report query. I think that you would like to make the WHOLE table span (left to right margin) the whole width of your detail band. Get the width available on your master report and find out how much width you need for both the subreport and the master report parts of the table.

 

 

LINKING:

 

Do not forget to link your subreport to the master report. If you don't do this correctly, you will not see the data from your subreport or your report will not compile.

 

Create the parameters in your subreport that you will use to link with your master report. You may make as many as you need or you may not need one at all.

 

Make sure that in you master report you set the following in the subreport element properties window:

1. Subreport Expression Class - this is usually set to java.lang.String. In your case I think this is what you should use.

 

2. Subreport Expression - the path to your .jasper (NOT the .jrxml file).

 

3. Subreport parameters - if you have any. place them here and link each of them to a parameter or field from you master report.

If you do not have any parameters to link, just make sure that your subreport query will supply the data you need to fill the subreport. However, I would STRONGLY SUGGEST using at least one parameter that you will use to filter the result set that will fill your subreport.

 

I know this is quite long but I hpe it helps.

 

 

Edwin

Link to comment
Share on other sites

Hi Edwin,

 

Thanks for you reply.

 

I did whatever you mentioned,the error was solved by fixing the subreport size but I still could not get the result I want.

 

I do not know in which band should I put my subreport to have the report like the LandscapeReport.jpg in the first post:(

 

I put the subrepprt in the header band and it looks so weired!

 

Then I put subreport in the detail band and I get the result like the report1.jpg I attach with this post!(This is not the type of report I'm looking forward to! :pinch: )

 

I appreciate anyone who can help me to solve my problem.

 

Thanks [file name=report1.zip size=38925]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/report1.zip[/file]

Post edited by: p_a, at: 2007/05/12 06:25

Link to comment
Share on other sites

Place ur subreport on detail band of main report.Use group by.(group expression= $F{somevalue}.this field value should be same for all row records of main report.

So that it will execute only once.

Link to comment
Share on other sites

Hi,

 

Thanks for your reply.

 

I made my report as you said but I get the same result as I attach in report1.jpg!!!!!

 

Can you give me an example where I can see what you've done correctly?

 

Thanks in advance,I am waiting for your reply.

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