Jump to content

sub report example


rida_10

Recommended Posts

HI ALL,,, 

ihave been working on ireport designer 3.0,  to develop sub reports

and i used the $R{subreports.folder} resource bundle to refer to the location for my sub report  as such:

 

$R{subreports.folder}  + java.io.File.separator + "Sub_TotalSummary.jasper"

 

where subreports.folder property refers to a location on the hard disk :

subreports.folder=D:/my-reports/build/3.0.0 (all .jasper reports are generated in this directory)

so where ever we want to run the report we only  change the value of subreports.folder 

 

THE QUESTION IS HOW TO REFER TO SUB REPORTS WHEN REPORTS ARE RUN FROM JASPER SERVER NOT FROM AN ORDINARY JAVA APPLICATION.

 

THANK YOU

RIDA

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi, I usually save the subreport in the same directory of master report and I'm using

$ P{SUBREPORT_DIRECTORY} + “subreport_name.jasper†as subreport exression.

When I create the report unit on JasperServer I put the subreport under "Resources" of the report unit. Hope to be usefull ...

A.

 

Link to comment
Share on other sites

Hi Rida,

I sow you solved your problem with my solution! I'm writing "my solution" for everybody else that see this thread ....

1) In iReport you can develop your master report with one ore more subreports. It's important to save the path of the directory of the subreport not as an absolute path (like C:\\my_jasper\\subreport.jasper) but using a parameter (if you use the wizard when you are designing you subreport in your master one, you have to check the right option, and the subreport path will be (Attachment 1):

$P{SUBREPORT_DIR} + "name_of_subreport.jasper"

 

2) When you will add the Report Unit on your JasperServer you will be asked the proposed expression for you subreport (Attachment 2). Click on "Continue" button to confirm the expression "repo:name_of_subreport.jrxml"

With such procedure JaspeServer will automacitally copy your subreport under the Resources directory of your report unit (Attachment 3)

Hope this should be usefull for everyboy.
Bye

Pioppogatto

 

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