sabiha Posted October 2, 2006 Share Posted October 2, 2006 Hi! I have been searching forum for a few hours trying to find out how to create new report on hyperlink click.I have main report with records containing basic data and i would like to have link for every single record and on its click to be opened new detailed report. Of course, i should also pass some parameters to detailed subrecord. I create records from Java stanalone application. Thanks in advance for help! Sabiha Link to comment Share on other sites More sharing options...
teodord Posted October 2, 2006 Share Posted October 2, 2006 Hi, Check the supplied /demo/samples/hyperlink sample.Note that it will be some servlet of your own that would answer to those hyperlinks so the URL will be something that you have to design yourself. JR only gives you the mechanism to attach them to text or images in the report. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
jerics99 Posted October 19, 2006 Share Posted October 19, 2006 Where is the /demo/samples/hyperlink sample found? Link to comment Share on other sites More sharing options...
lucianc Posted October 19, 2006 Share Posted October 19, 2006 Download the jasperreports-x.y.z-project package from here and unpack it. You'll find all the JR samples under demo/samples. Regards,Lucian Link to comment Share on other sites More sharing options...
jerics99 Posted October 19, 2006 Share Posted October 19, 2006 Thanks for your help, but the example did not include hyperlinks passing parameters so the sample did not help. /E Link to comment Share on other sites More sharing options...
lucianc Posted October 24, 2006 Share Posted October 24, 2006 You can add parameters to your hyperlinks in two ways:Simply append GET parameters to the URL, e.g.Code:<hyperlinkReferenceExpression> <![CDATA[ "http://my.server/my.report.servlet?report=myReport" + "¶m1=" + $F{field} + "$param2=" + $V{var} + etc ]]></hyperlinkReferenceExpression>(JR >= 1.2.6) Create a custom hyperlink type and add hyperlink parameters:Code:[code] <textField hyperlinkType="MyReportHyperlinkType"> <hyperlinkParameter name="report"> <hyperlinkParameterExpression>"myReport"</hyperlinkParameterExpression> </hyperlinkParameter> <hyperlinkParameter name="param1"> <hyperlinkParameterExpression>$F{field}</hyperlinkParameterExpression> </hyperlinkParameter> </textField> When you export the filled report to HTML, you'll need to set the JRHtmlExporterParameter.HYPERLINK_PRODUCER_FACTORY parameter to a JRHyperlinkProducerFactory instance that can handle MyReportHyperlinkType hyperlinks.[/ul] HTH,LucianPost edited by: lucianc, at: 2006/10/24 09:28 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now