Jump to content
Changes to the Jaspersoft community edition download ×

Subreport Not Appearing Version 0.5.0


2005 IR Help

Recommended Posts

By: steveT - stevetucknott

Subreport Not Appearing Version 0.5.0

2005-05-30 09:41

I am a newbie and have a problem with getting subreports to work.

I have viewed the 'subreport' tutorial and tried to copy what it says, but the subreport 'does not appear'.

I have added a TITLE to the subreport to see if that appears - just in case the parameter passed from the master was wrong and no actual data was being read - but even the title doesn't show.

If however, I change the parameter definition in the detail from an Integer to Long, then I get a casting error, so it does seem that the detail is being started

Also, when I set up the parameter in the detail, the tutorial said use ${paramName} rather than $P{paramName} - is that correct? Using ${paramName} causes an error when running the detail in standalone mode. - although it does compile ok.

As an side, the tutorial also implies that you can click on the open file name on the left and that automatically opens the correct designer - that doesn't work with my installation. I have to minimise the master, maximise the detail in the designer window (and vice versa) to activate the correct file.

I would post the jrxmls but I cant see how you attach files!

 

 

 

 

By: Giulio Toffoli - gt78

RE: Subreport Not Appearing Version 0.5.0

2005-05-30 12:38

$() is not a correct syntax, use $P{} instead.

be sure the band where the subreport is printed in, is visible (i,e, placing a coloured rectangle)

 

Giulio

 

 

 

 

By: steveT - stevetucknott

RE: Subreport Not Appearing Version 0.5.0

2005-05-30 23:44

Giulio,

I had tried both ${} and $P{} before, but I tried again this morning. Still no Report. I have put static texts in the master summary/footer bands and all of those appear (apart from the page footer!).

I have also put the passed record number in the master detail band above the subreport - that appears ok - so the value of the parameter is good when it is passed to the subreport.

If I run the subreport as a stand alone - it runs ok (although if I try to put the literal value 1 as the default for the parameter I get a cast error from int to integer - is that to be expected?) and as I said, if I change the 'type' of the received parameter, I get a cast error when the subreport is triggered.

As far as I can see, both the subreport and the master reports are in 'visible' areas.

I'm running on Linux (RedHat 8) with the 1.4.2.08 SDK

 

 

 

 

By: steveT - stevetucknott

RE: Subreport Not Appearing Version 0.5.0

2005-06-15 04:06

Don,

No, I'm still in the same boat. I can't see that I have done anything wrong so far.

I hadn't pressed it as I have had to move onto something else for the moment.

I assume that subreports are working ok, as there are other comments on the list with regard to subreport output - so it must be something I'm doing wrong. My next plan of attack was to try linking via my Windows PC and see if I could get that to work (to rule out any issue with the Linux JVM)

Sorry I can't be of more help - if I get it to work I'll post on this thread. I'd appreciate it if you could do the same!

 

 

 

 

By: C-Box - c-box

RE: Subreport Not Appearing Version 0.5.0

2005-06-15 05:44

When I remember right the IReport 0.5.0 release contained the JasperReports 0.6.7 library, isn't it?

 

In this JasperReports release was a bug that was related to SubReport appearance also.... so what I'd suggest to you is to upgrade to JasperReports 0.6.8 ... simply download the library from JasperReports homepage and replace it with the 0.6.7 file within the iReport "lib" directory.... then adjust the "compatibility" to "use the latest JasperVersion available" from the iReport menu and try again what now doesn't work.

 

hth

C-Box

 

 

 

 

By: Aquarius - aquarius

RE: Subreport Not Appearing Version 0.5.0

2005-07-06 08:49

I can confirm the same thing, the subreport not appearing, using iReport 0.5.0 on Windows with the Sun JDK. I've tried upgrading JasperReports to 0.6.8 as suggested and it hasn't fixed the issue. I've also tried setting the background colour of the subreport to bright orange, and a bright orange block does appear in the generated PDF, so it is at least recognising that there is something there. The bright orange block is empty of content.

The subreport has, in "Subreport (Other)", the subreport expression "c:/sil/programs/iReport-0.5.0/letter_subreport.jasper". That file exists and is a compiled report, but it is not being included. (I've tried it with a non-existing file in there and it doesn't compile the main report, so it must be finding the file OK.)

Any other suggestions are welcome; the .jrxml files are at http://www.kryogenix.org/random/drill2.jrxml (main report) and http://www.kryogenix.org/random/letter_subreport.jrxml (subreport) if that's useful (although you obviously don't have my datasource or database server!)

 

 

 

 

 

By: C-Box - c-box

RE: Subreport Not Appearing Version 0.5.0

2005-07-06 23:47

Try to set the attribute "whenNoDataType" from "NoPages" to "AllSectionsNoDetail" within your subReport and place a static text field in your pageheader just to see if the problem is because of wrong/missing datasource or not.

 

C-Box

 

 

 

 

By: Aquarius - aquarius

RE: Subreport Not Appearing Version 0.5.0

2005-07-07 03:31

I've set whenNoDataType to AllSectionsNoDetail, and it hasn't helped. My subreport has a static text box in it as well as a data field, and nothing on the subreport is displaying (other than the yellow-coloured background box that's applied to the subreport area in the main report).

 

 

 

 

By: C-Box - c-box

RE: Subreport Not Appearing Version 0.5.0

2005-07-07 03:54

Very strange....

 

I do have one master... this master has 7 subreports... each subreport is within it's own dummygroupheaderband. One SubReport contains another three nested subreports each again in it's own dummygroupheaderband. Each dummygroupheaderband can have a printwhenexpression where the printout is controlled at current field-values. So all in all in my opinion a quite complex structure but it's working well. I guess as I'm working with CustomDataSources and not with direct-connection I don't have the troubles that you have, but it should work also.

 

So I can't say more or have any other ideas as I posted. Sorry! Try to abstract your problem and step back some subreports till it is working and then go step by step forward.

 

C-Box

 

 

 

 

By: Aquarius - aquarius

RE: Subreport Not Appearing Version 0.5.0

2005-07-07 07:10

Ah-ha! Worked it out. I was stupid. My SQL query in the subreport was using $F{parameter-name} and it should have been using $P{parameter-name}. So it was all my own fault! Glad I worked that out.

 

 

 

 

By: Don Thompson - sycodon

RE: Subreport Not Appearing Version 0.5.0

2005-06-15 01:23

HI,

 

Did you ever resolve this? I'm in he same boat at the moment. I'm not quite sure what he means when he says make sure the band is visible. I can't find anything in the docs or in the app that would allow it to be invisble.

 

Can you fill me in on what you have found?

 

Thanks

 

 

 

 

By: Chris Cureau - ccureau

RE: Subreport Not Appearing Version 0.5.0

2005-06-15 15:36

I don't know if this will help or not, but I'll contribute anyway, just in case...

 

I found that when doing a subreport in the footer of a grouping, only the last group footer would print in the report. What I needed to do was to add the primary key to the Group Expression under the Grouping Add/Modify window. After carefully reading the documentation, I found that the group header and footer only print if the value in the Group Expression changes. After doing that step, my subreports print fine.

 

 

 

 

 

By: steveT - stevetucknott

RE: Subreport Not Appearing Version 0.5.0

2005-07-06 06:45

I have revisited this and still can't get it to work.

Whether this is because I'm running on Linux rather than Windows or it's just simply that I'm doing something wrong I don't know.

I have the subreport set up in the detail band of the master. I pass $F{clientbranchrecno} as clientBranchRecNo to the subreport. The subreport hasa a parameter defined (clientBranchRecNo) that is used in the subreport query as $P{clientBranchRecNo}. Both the passed and received parameters are java.lang.integer.

 

I have made the subreport parameter promptable to see if it gets to that stage - it prompts ok if I run the subreport as a standalone, but I get no prompt at all when running the master report.

....... - any ideas ???

 

 

 

 

By: steveT - stevetucknott

RE: Subreport Not Appearing Version 0.5.0

2005-07-06 09:58

So it seems that Windows/Linux is not the issue - I have also upgraded the jasper jar to 0.6.8. Si presumably that's not the issue either. Going by other threads on this list, other people have this working fine.

Is there some limitation as to which 'band' the subreport can appear in (mine is in the detail of the master)?

Is there a way to see what is happening when the report runs (a debug level)?

 

 

 

 

 

By: Andrew - andrew_d

RE: Subreport Not Appearing Version 0.5.0

2005-07-06 12:39

I am having this problem as well. If anyone has advice I'd love to hear it - I'm new to iReport and would love to be able to actually use it. I'm sure this is just a silly mistake on my part, but being new I don't know where I'm going wrong.

 

Details:

I tried to follow the tutorial as best I could.

My master report has a variable cs_rid that is type Integer. I pass this down as a parameter called SITE_ID.

In the subreport I have a parameter of type Integer that is called SITE_ID and has a default value of new Integer(6) and prompts for input as well. In my subreport's query I have $P{SITE_ID}. I can run the subreport and it will prompt me for a value and display everything OK. If I run the master report it shows a big colored block where the subreport should be (I messed with the subreport properties to give it a blue background) but doesn't print any of the subreport.

 

The subreport's jasper file is sitting in the iReport folder where it was compiled from. In the Subreport(Other) properties window I have Image Expression Class of java.lang.string and a subreport expression of "leadership.jasper". I don't get errors when running the report, although I *do* get errors if I give it a nonexistent subreport file. I've also tried using "c:\ireport\leadership.jasper" and "c:/ireport/leadership.jasper", both of which run OK but don't display any subreport.

 

I'm not sure what else to try...any help would be greatly appreciated!

 

 

 

 

By: steveT - stevetucknott

RE: Subreport Not Appearing Version 0.5.0

2005-07-07 10:23

OK - I've now got it working. I have changed a few things - so I'm not 100% that this last thing was the COMPLETE reason.

However, in my case, if I look at the subreport properties on the Master report, there are two tabs. One of them is mentioned in the video tutorial (subreport (Other))- that is where you put the link to the subreport ie the full path to the subreport jasper file. The other tab (subreport) contains two fields:

Parameters Map Expression

and

Connection / Datasource Expression

 

I left the first field (Parameters Map...) blank, and chose 'Use Connection Expression' from the drop down list for the value of the second - by doing that the second field (Connection / Datasource Expression) was automatically set to:

$P{REPORT_CONNECTION}

 

Now the subreport runs.

 

Hope that helps anyone else who may have the same problem. Mail me off list if you want screenshots of what I have set up (stevetucknott@yahoo.co.uk)

 

 

 

 

By: Andrew - andrew_d

RE: Subreport Not Appearing Version 0.5.0

2005-07-07 11:50

Hah - talk about timing. I also just figured out that I had to pass the connection down for things to work and had come back to post as much - I see you've got it too, Steve.

 

Thanks for the AllSectionsNoDetail suggestion, c-box; the comment on datasources pointed me in the right direction.

 

 

 

 

 

 

By: steveT - stevetucknott

RE: Subreport Not Appearing Version 0.5.0

2005-07-07 09:55

C-Box,

What is 'dummygroupheaderband'?

Do subreports have to be in a specific band? I just dragged the subreport into the detail band of the master - should that work?

 

 

 

 

By: C-Box - c-box

RE: Subreport Not Appearing Version 0.5.0

2005-07-07 23:47

If you are using MULTIPLE SubReports it's better that you create a own "dummy group" for EACH SubReport you want to use... if you place for example three subreport below each other into the detailband and set the positiontype to float you will although recognize overlapping subreports if the break pages... so I do put each subreport in it's own "dummygroupheaderband" that's why.

 

hth

C-Box

 

 

 

 

By: Bikkina - saradabikkina

RE: Subreport Not Appearing Version 0.5.0

2005-07-08 03:24

Hi,I have tried using subreport but when i try to execute the master report i am getting an error while filling report.

can anyone please help me out in this.

 

here is the stack trace of the error

 

 

Filling report... Error?filling?print... java.io.StreamCorruptedException:?invalid?stream?header ????at?java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737) ????at?java.io.ObjectInputStream.<init>(ObjectInputStream.java:253) ????at?net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:84) ????at?net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:235) ????at?net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:294) ????at?net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:339) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1254) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:586) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:210) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:118) ????at?net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:622) ????at?net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:489) ????at?net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:76) ????at?net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) ????at?net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:163) ????at?it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:550) ????at?java.lang.Thread.run(Thread.java:534) NESTED?BY?: java.io.StreamCorruptedException:?invalid?stream?header ????at?java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737) ????at?java.io.ObjectInputStream.<init>(ObjectInputStream.java:253) ????at?net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:84) ????at?net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:235) ????at?net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:294) ????at?net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:339) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1254) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:586) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:210) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:118) ????at?net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:622) ????at?net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:489) ????at?net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:76) ????at?net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) ????at?net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:163) ????at?it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:550) ????at?java.lang.Thread.run(Thread.java:534) NESTED?BY?: net.sf.jasperreports.engine.JRException:?Error?loading?object?from?file?:?c:iReport-0.5.0ireport-0.5.0subreport.jrxml ????at?net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:89) ????at?net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:235) ????at?net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:294) ????at?net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:339) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1254) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:586) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:210) ????at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:118) ????at?net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:622) ????at?net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:489) ????at?net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:76) ????at?net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) ????at?net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:163) ????at?it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:550) ????at?java.lang.Thread.run(Thread.java:534) Caused?by:?java.io.StreamCorruptedException:?invalid?stream?header ????at?java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737) ????at?java.io.ObjectInputStream.<init>(ObjectInputStream.java:253) ????at?net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:84) ????...?14?more Print?not?filled.?Try?to?use?an?EmptyDataSource...!

 

 

 

 

By: Peter - fitek81

RE: Subreport Not Appearing Version 0.5.0

2005-07-19 11:14

I also get an error when trying to run the master report:

 

Filling report...

Error?filling?print... net.sf.jasperreports.engine.JRException:?Infinite?loop?creating?new?page. ????

at?net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageBreak(JRVerticalFiller.java:1144)

 

...

 

Try to use an EmptyDataSource...!

 

 

This happens when I choose properties for the subreport, then set the connection / datasource expression to $P{REPORT_CONNECTION}

 

When I set this drop down to Don't Use Connection or Datasource the sub report comes up with no detail band. It is getting the primary key that I pass in because I have a text field in the header of the subreport that prints it out. Running the subreport alone and entering in an invalid primary key gives me the same behavior; valid keys print a detail band.

 

My master report query goes something like this: select patientnumber from bs_table

 

Then the subreport works like:

select * from bs_table where patientnumber=$P{patientnumber}

 

So there must be some other secret sauce to making the subreports work because for me changing the Connection/Datasource Expression causes another problem!

 

 

 

 

By: dhirajvs - dhirajvs

RE: Subreport Not Appearing Version 0.5.0

2005-07-21 00:18

Hi,

I am having a similar problem with IReports. When i try to add a SubReport & set the User Connection Expression & value as $P{REPORT_CONNECTION}, it goes into an infinite loop when i try to view the results.

 

Any help would be appreciated.

 

Thanks & regards,

Link to comment
Share on other sites

  • 1 month later...
  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Oke I've tried like any other one here everything and come to the conclusion that it **^% s. That something simple as a subreport is this difficult to use. The effect of my conclusion is that I simply won't use subreports for my project, or deviate to a different tool.
Link to comment
Share on other sites

  • 1 month later...

I am resurecting this thread. I have the same problems as the above, but no solution has worked.

 

I am attempting to create the simplest case of a subreport. I have read a ton of threads, watched the flash demo and read the pdf demo for subreports. All I am doing is this:

 

1. Create a new report, no data source.

2. Add a static text field to one of the bands.

3. Compile and run the report, looks great.

4. Use the iReport wizard to create a subreport. Create the subreport with no data source. Place the subreport in the detail band of the master report (I have tried many different bands).

5. Create a few coloured rectangles, and some static text.

6. Compile and preview the subreport..looks great.

8. Now, I run the master report and the subreport simply does NOT show up.

 

I am using rReport 1.2.8. Other points of interest:

- I have tried this on both Windows and Linux.

- I prompt for the subreport file name, when passing in something bogus it throws an error, so this makes me believe that the master report is indeed finding the subreport.

- I couldn't fine the "whenNoDataType" attribute of the subreport, so I didn't try that tip in this thread.

- When I right click on the sub report element on the master report and select "open subreport" it opens it.

 

I must be doing somthing obvous wrong, but don't have a second set of eyes....any tips would be appreciated!

 

Thanks

Link to comment
Share on other sites

You have to have a query in the main report. I ran into the same problem, it's caused me much frustration. I have asked the question on this forum before about how to create reports without a query, and I never received an answer.

 

If you don't have a query, do something simple, like

"SELECT @@VERSION"

 

Best of luck.

Link to comment
Share on other sites

ntobik wrote:

You have to have a query in the main report. I ran into the same problem, it's caused me much frustration. I have asked the question on this forum before about how to create reports without a query, and I never received an answer.

If you don't have a query, do something simple, like
"SELECT @@VERSION"

Best of luck.

 

ntobik, it seems that you are onto something here as all the examples and tutorials include queries. I don't have my report querying, I load it all using paramaters right from java.

 

Can you please be a bit more specific about just using a simple query like the one provided. In the mean time I can try mapping something from my data base just for the sake of it.

 

Thanks for your help.

Link to comment
Share on other sites

  • 11 months later...

hai,

 

 

try your report seperate to see your report work correctly. between your masterreport and subreport

 

after that in subreport component on masterreport click tab subreport pick "use connection expression"

 

and tab subreport(other) put your subreport file (fullpath example c:developmentreportmysubreport.jrxml)

 

 

i hope this will help you

 

 

regrads,

Link to comment
Share on other sites

I'm having the same issue where I do not get any data to display on my subreport. I have tried everything and used every advice I could find and still I do not see my data. I'm using the same xml datasource for both the master report and sub report.
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...