mulcamd Posted September 13, 2011 Share Posted September 13, 2011 I have a very simple working report, see attachment. It is based on the Sample database provided with iReport and JasperReports Server.What I want: I want to have a hyperlink to a text field element in the same report.In the sample report provided, click on the "Link to summary" and one should jump to the Summary text field.In iReport this works fine in the Internal Preview, in PDF, in HTML. All works fine.When imported into the JasperServer, I get a gray empty page. So in JasperServer this is not working.See the first image added. The second image shows the hyperlink address in JasperServer when I hoover with the mouse over de link.Since I'm referring to a location in the same document, I used as Hperlink target: Self and Hyperlink type: LocalAnchorI'm using iReport 4.0.2 and JasperReports Server CP 4.1.0.I need a way that works both in iReport and JasperServer.Post Edited by mulcamd at 09/13/2011 18:31 Link to comment Share on other sites More sharing options...
naveen.sharma Posted May 5, 2014 Share Posted May 5, 2014 http://helicaltech.com/blogs/86/ Link to comment Share on other sites More sharing options...
naveen.sharma Posted May 5, 2014 Share Posted May 5, 2014 In Report 1:Step 1: Connect to database (Click on database icon and give all the details and test it )Step 2: delete all the not needed bands(If we don’t delete it leads to page gaps in the output)Step 3: Write a simple query in Report Query area ( Just right click on report name in theReport Inspector then Select the query)I’ve given like this : select 1 as OneStep 4: The bands I’m interested to take are : Column header and Detail bands respectively.Step 5: Drag and drop the field to detail area And drag and drop a text field from palette tocolumn header.The below image gives somehow idea.http://helicaltech.com/blogs/wp-content/uploads/2013/05/Hyperlink-300x168.pngStep 6: Giving Hyperlink to text fieldi) Write text in double quotes like : “Hyper link”.( Text field should take double quotes whereas static text field doesn’t take double quotes and doesn’t applicable to create hyperlink)ii) Right Click on the text field ->Click on Hyperlink-> It opens a windowsee the sample in the following imagehttp://helicaltech.com/blogs/wp-content/uploads/2013/05/Hyperlink2-300x156.pngiii) Give Hyperlink target as : BlankHyperlink type as : ReportExecutioniv) Click on Link Parameters.. Give Link parameter name as : _reportParameter Class Name as : java.lang.StringValue Expression : location/Path of the second report in the serverfor example the path is : ”/reports/Demos_Sadakar/HyperLinkDemo/Hyperlink_Report2″We can observe the location in the below imagehttp://helicaltech.com/blogs/wp-content/uploads/2013/05/Hyperlink3-300x79.pngNOTE : Remember that Hyperlink_Report2 in the URL is the ID of the jasperReport when we give at the time uploading report to server.. i.e, it is not the name of the Report. http://helicaltech.com/blogs/wp-content/uploads/2013/05/Hyperlink4-300x76.pngStep 7: Now save the report and upload to the server(Hope we know how to upload a report to server. Please find how to upload a report to server in the list of posts of my blog)In Report 2:( A normal report with row banding functionality)Step 1: Create a report and write query in query area(Give same database details.. foodmart details)I have taken this query : select * from employeeStep 2: Just drag and drop fields from Fields node of Report Insepector to Detail band.( dragging only few fields)Step 3: Now we are working on row banding.i) Go to Report Inspector panelii) Right click on Style option and Add some style.. I’ve given default name as style1iii)Right click on style1 and select Add Conditional Styleiv) Now double click on it and i’ll open Expression Editor.. there we need to give the follwoing conditionnew Boolean($V{REPORT_COUNT}.intValue() % 2 == 0)In the above expression $V{REPORT_COUNT} is the default variable provided by jasperians in iReport. Check variables in the Report Insepctor.http://helicaltech.com/blogs/wp-content/uploads/2013/05/Hyperlink5-300x143.pngv) Go to the properties of Conditional Style expression it opens it’s poperties( not click on Style1.. click on the conditional thing). In the properties window select give your favourite BackColor.I’m showing the scenario in an image.http://helicaltech.com/blogs/wp-content/uploads/2013/05/Hyperlink6-300x49.pngNOTE: do not check Opaque check box. just leave it.Step 4: Now select the fields you want to apply for the fields. I’ve selected all the fields that I’ve dragged to the Detail band. You can observe the multiple Objects properties window on the right side.From the properties go to style and give the style1( just click on it it’ll show all the created styles.. In our example we have created only one style i.e, style1) http://helicaltech.com/blogs/wp-content/uploads/2013/05/Hyperlink8-300x53.pngThat’s it. Now save the report and see the output of the report in the server . It’d look like the followinghttp://helicaltech.com/blogs/wp-content/uploads/2013/05/Hyperlink9-300x220.pngExecution of the Reports using hyperlink- Final Output.NOTE : When we create an hyperlink and if it works fine then the color of the text changed to light blue and it’ll have underscore on mouseover.First Report Output:http://helicaltech.com/blogs/wp-content/uploads/2013/05/Hyperlink10-300x44.png Now click on “Hyper Link” that we are seeing on..It’ll redirect to another page which we call it as hyperlink functionality in iReport.http://helicaltech.com/blogs/wp-content/uploads/2013/05/Hyperlink9-300x220.png<em>:)</em> <em>:)</em>Thanks for your time to read this tutorial <em>:)</em> <em>:)</em> <em>:)</em>for any queries : Link to comment Share on other sites More sharing options...
destek Posted April 11, 2015 Share Posted April 11, 2015 The same link double HyperLink reference given to different reports? Link to comment Share on other sites More sharing options...
khushal.solanki8 Posted May 18, 2017 Share Posted May 18, 2017 it is not work in jaspersoft designer 5.6.0 Link to comment Share on other sites More sharing options...
kiranmaisep6th Posted November 24, 2017 Share Posted November 24, 2017 HiI have one query.I have main report and sub report A in the same main report.I have a scenerio where clicking on the text field in one sub reports(subreport A) should open another sub report(sub report B) .Could any one help me on this?Thanks in Advance. 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