Jump to content

Help:subreport generation from java code.


Recommended Posts

Thanks admin,

It raises one more question like how can I get a subreport by clicking on a text field hyperlink in master report.

I am confused like whether I need to put a subreport element on master report itself or I just need to right click on hyperlinked text field and in its properties I need to give the path of subreport.jasper file.


Actually its not cleared in documentation that what hyperlink type i need in order to have a subreport in masterreport and what one is needed to write in "HYPERLINKED ANCHOR EXPRESSION" field.


When I am giving subreport.jasper file in reference expression,I am not getting a html output rather I am getting A jasper view of file.


Plz do tell me what should I need to do get a hyperlinked generated subreport from a java code.


What should I place on my masterreport to do this?

What parametre I need to set up and their values as well?


Also In java code what should I write?


Do I need a separate servlet code for subreport?


where to put all .jasper files in my tomcat/webapp/...



Plz I know These can be basics but It Will help others also.


If you have any links,codes,tuorial ,you are welcomed.

I am attaching my servlet code for reference.




Post edited by: neetikamittal, at: 2006/08/01 01:07

Post edited by: neetikamittal, at: 2006/08/01 01:10

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi Neetika,


please note that subreports are not separated reports, but reports inside a parent report (i.e. you can use a subreport to print the rows of an invoice...).


You are talking about drilldown and drillup features that are not supported directly from JasperReports. The purpose of an hiperlink is not to provide

a way to execute another report. You need to design your own mechanism to provide a report generation service, i.e. using a servlet, so you can

insert as link in your master report something like:




With this link your servlet "executeReport" should execute the report named "customerDetails", exporting it in html and using the provided parameters...

Of course this is only an invented sample .



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