RESOLVED: JasperReport Server report reference to sub-reports

0

I have a report Report1 that contains a lot of sub-reports (subReport1, subReport2, etc...) linked inside a table (in the table cell i have insert a sub-report).

In JasperStudio i have put all subreport's file in a folder in the same project:

MyProgect/

Report1.jrxml

Report1.jasper

/subReports

subReport1.jrmxl

subReport2.jrxml

subReport3.jrxml

subReport1.jasper

subReport2.jasper

subReport3.jasper

Report1 reference to the subreports by her *.jasper file (exemple of Expression parameter: "subReport/subReport1.jasper) and work perfectaly.

Now, when i put all in the server (maintaining the same folder hierarchy but all put in the server's folder /Process) i have this error:

The server has encountered an error. Please excuse the inconvenience.

Error Message

net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Resource not found at : subReports/subReport1.jasper

How i can fix this problem?

(i have try to change the path to /Process/subReports/subReport1.jasper but nothing...)

cek.i06go's picture
Joined: Dec 24 2013 - 9:00am
Last seen: 4 years 8 months ago

3 Answers:

0

Hi,

You should better use a reference like : "repo:subreport1.jrxml" for your subreports.

If you do this way you have to upload the relative jrxml file under the "Ressources" path of your main report (iReport) or directly in the main report path (jaspersoft studio) .

You'll have somthing like :

printscreen jasperstudio tree

 

 

 

olivfsk's picture
33
Joined: Oct 16 2013 - 7:32am
Last seen: 4 years 4 months ago

i have found the solution!
when i add a subreport under a table cell, jasperstudio don't load automaticaly the jrxml file of sureport, so you need to upload and change the reference manually with the uri (if sub report is load in the mainreport resources):
repo:/subReport
or the absolute path
/folder_to_the_mainReport/mainReport_files/subReport

I don't know why jasperStudio have this behavior, but you just need to figure out how to make remedy :)

cek.i06go - 5 years 3 months ago
0

Hi,
did you tried to publish the report using the "Publish" button in the inner report editor toolbar?

Regards,
Massimo.

mrabbi's picture
6500
Joined: Oct 31 2011 - 9:20am
Last seen: 1 month 1 week ago
0

You must compile. Then, you can find .jasper file in directory of project.

gizem.tuncer's picture
Joined: Aug 2 2017 - 5:12am
Last seen: 1 year 8 months ago
Feedback
randomness