[#8186] - Hyperlink When Expression Doesn't Seem to Have Any Effect

Category:
Bug report
Priority:
Normal
Status:
Closed
Project: Severity:
Minor
Resolution:
Unable to Reproduce
Component: Reproducibility:
Always
Assigned to:
0

It is necessary, in certain circumstances, for a hyperlink to be deactivated on a report element. We've tried using the Hyperlink When Expression, but it has no effect on whether the link works or not. As a workaround, we just add some conditional statements to the Hyperlink Reference Expression, but this doesn't remove the user cue for the link (i.e. the cursor still changes to a pointer).

If this is not the intended purpose of this field, then what is it for? And would it be possible to add a feature that does what we describe above?

If it is the intended purpose, we'd like to see it fixed. We also want to make sure that the user cue is disabled as well as the link (curse remains as arrow/text and does not become a pointer finger). Or is there something special we need to do to use it?

Thanks,
Jeff

v6.2.1
jlyons's picture
15
Joined: Jul 30 2015 - 10:43am
Last seen: 1 month 5 days ago

11 Comments:

#1

The problem should have been fixed in 6.2.1 at https://sourceforge.net/p/jasperreports/code/ci/0781020d1ed3

Could you confirm that you are using 6.2.1? If so, please describe a detailed test case to reproduce the problem.

Regards,
Lucian

#2

It's not working with 6.3.0. The problem is JasperReports is using Boolean instead of boolean. I think I've submitted how to fix this issue somewhere.
The simple solution is just to change one line in engine/fill/JRFillTextField.java as below.
if (getHyperlinkWhenExpression() == null || (hyperlinkWhen != null && hyperlinkWhen))

I think it's actually better to do replace class Boolean with primitive boolean.That is, change (Boolean) in following to make it work with (boolean)
hyperlinkWhen = (Boolean) evaluateExpression(getHyperlinkWhenExpression(), evaluation);

#3
  • Assigned:nobody» lucianc

You're right @hozawa, the hyperlinkWhen test is faulty. I checked in a fix at https://sourceforge.net/p/jasperreports/code/ci/649150ca4dc073255d41eb12...

I can't say whether this was the problem that Jeff was facing, a detailed test case is required.

Thank you,
Lucian

#4
  • Resolution:Open» Fixed

This seems to be working now. Thanks!

#5
  • Status:New» Resolved
#6
  • Priority:Low» Normal
  • Resolution:Fixed» Reopened
  • Status:Resolved» Assigned

As of 6.4.2, this is still not working.

#7

@jlongoria please include a test case to reproduce the problem you're experiencing.

#8

The text field's hyperlinkWhen expression has the expression 'true == false', which is should evaluate to false.

When published to JasperReports Server, the hyperlink remains active and clickable.

AttachmentSize
Binary Data hyperlink_test.jrxml1.66 KB
#9

I ran the report you attached in JRS 6.4.2 and there was no hyperlink on the text element. Can you describe in detail how you run the report in JRS 6.4.2?

#10
  • Status:Assigned» Feedback Requested
#11
  • Resolution:Reopened» Unable to Reproduce
  • Status:Feedback Requested» Closed

I ran the attached report on Jaspersoft Studio 6.5.1 and hyperlink was inactive with 'true == false' and active with 'true == true' so there's no problem with JasperReports library.

Feedback
randomness