US and Worldwide: +1 (866) 660-7555
Results 1 to 9 of 9

Thread: Hyperlinks with parameters

  1. #1
    Join Date
    May 2009
    Posts
    12

    Default Hyperlinks with parameters

    Hi,

    I want to use Hyperlinks in my report. The target of th hyperlink changes with the values of parameters. How do I use parameters in my hyperlinks. I am looking for documentation regarding the parameters. I am not able to find it. Can anybody help me out with this?

  2. #2
    Join Date
    Sep 2008
    Posts
    847

    Default

    Do you want to pass different values in the hyperlink with the same parameters or do you want to create different hyperlinks according to the values in the row?

    different values should be easy with the hyperlink function (./asdf={0} ...)
    for different targets you can use e.g a formulaexpression to create the correct string ... IIF(value1 = xy;"localhost/target1";"localhost/target2");
    Check out the saiku project ( online demo ) - next generation open source analytics

    Quote Originally Posted by bugg_tb
    Join the Unofficial Pentaho IRC channel on freenode.
    Server: chat.freenode.net Channel: ##pentaho

    Please try and make an effort and search the wiki and forums before posting!

  3. #3
    Join Date
    Mar 2003
    Posts
    7,996

    Default

    The Hyperlink-Expression is just a complicated way to create URLs - you can do everything the function can with Formulas as well:

    For instance, this formula lets you do a Google-search based on a value found in a field:
    Code:
    ="http://www.google.com/search?q=" & URLENCODE([myfield], "ISO-8859-1")
    Like in Excel, the ampersand (&) is used to concatenate strings. The text returned as hyperlink itself is *not* interpreted as URL, so you can put anything in there, as long as your browser understands it:

    Code:
    ="javascript:alert('" & [yourfield] & ")"
    (Warning: Using this example in the real world with unchecked or unsafe values in the field will lead to security vulnerabilities. Do not pass unsanitized user-input directly to the browser.)
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  4. #4
    Join Date
    May 2009
    Posts
    12

    Default

    Quote Originally Posted by pstoellberger View Post
    Do you want to pass different values in the hyperlink with the same parameters or do you want to create different hyperlinks according to the values in the row?

    different values should be easy with the hyperlink function (./asdf={0} ...)
    for different targets you can use e.g a formulaexpression to create the correct string ... IIF(value1 = xy;"localhost/target1";"localhost/target2");
    I want to pass different values to the hyperlink with the same parameters.

  5. #5

    Default

    Anyone found the solution?

  6. #6
    Join Date
    Mar 2003
    Posts
    7,996

    Default

    As this is in the PRD forum, I will give a PRD solution:

    ="http://www.google.com/?q=" & [yourfield]

    See the formula syntax page on the wiki ( http://wiki.pentaho.com/display/Repo...la+Expressions ) or just read Will Gorman's excellent book on Pentaho reporting.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  7. #7

    Default

    ="http://turbodog/cpxcrm/index.php?action=DetailView&module=Cases&record="&URLENCODE([ID])&"&offset=1&stamp=1282238409083239200"

    This worked for me The pink part is constant, the Red part is the variable that I am passing from the SQL query.

  8. #8
    Join Date
    Jun 2006
    Posts
    282

    Cool Another option

    This is an example of what I typically use for opening up .prpt files in a new tab. If anyone has an easier method please share.

    Code:
     
    ="javascript:if (top.mantle_initialized) 
    { top.mantle_openTab('Detail For " & URLENCODE([Patient]) & "', 'Detail For " & URLENCODE([Patient]) & "', '"& [env::pentahoBaseURL] & "content/reporting?renderMode=report&solution=qm&path=Reports/Sub Reports&name=clinic_result_detail.prpt&parmMRN=" & URLENCODE([MRN]) & "'); 
    } 
    else 
    { top.reportViewer_openUrlInDialog('Detail For " & URLENCODE([Patient]) & "', '"& [env::pentahoBaseURL] & "content/reporting?renderMode=report&solution=qm&path=Reports/Sub Reports&name=clinic_result_detail.prpt&parmMRN=" & URLENCODE([MRN]) & "', '1200px','600px'); 
    } "
    Last edited by microdisney; 08-23-2010 at 07:52 PM.
    "If you want to increase your success rate, double your failure rate."
    Thomas Watson, Sr (former president of IBM)

  9. #9
    Join Date
    Apr 2010
    Posts
    4

    Default

    Quote Originally Posted by microdisney View Post
    This is an example of what I typically use for opening up .prpt files in a new tab. If anyone has an easier method please share.

    Code:
     
    ="javascript:if (top.mantle_initialized) 
    { top.mantle_openTab('Detail For " & URLENCODE([Patient]) & "', 'Detail For " & URLENCODE([Patient]) & "', '"& [env::pentahoBaseURL] & "content/reporting?renderMode=report&solution=qm&path=Reports/Sub Reports&name=clinic_result_detail.prpt&parmMRN=" & URLENCODE([MRN]) & "'); 
    } 
    else 
    { top.reportViewer_openUrlInDialog('Detail For " & URLENCODE([Patient]) & "', '"& [env::pentahoBaseURL] & "content/reporting?renderMode=report&solution=qm&path=Reports/Sub Reports&name=clinic_result_detail.prpt&parmMRN=" & URLENCODE([MRN]) & "', '1200px','600px'); 
    } "
    Hi,

    I know this thread is too old, but I was trying to do the same and I can't find a solution (link a report to another in a new tab)

    I use the solution above, and I can open a new tab, but ONLY works in firefox, I need to do this in Explorer and Chrome

    anyone knows how to do it?

    thanks in advance

    Jordi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •