Birt Drill Down using own hyperlink does not work

Pradeep8229
edited February 11, 2022 in Analytics #1

Well I am trying to create a hyperlink on Birt report from master report for a drill down report.

This is my Code:

<label id="140"> <property name="fontFamily">"Arial"</property> <property name="fontSize">7pt</property> <property name="fontWeight">bold</property> <property name="fontStyle">italic</property> <property name="textUnderline">underline</property> <property name="marginTop">0pt</property> <property name="textAlign">left</property> <structure name="action"> <property name="formatType">html</property> <property name="linkType">drill-through</property> <property name="reportName">review-agent-by-policy.rptdesign</property> <property name="targetBookmarkType">bookmark</property> <property name="targetWindow">_blank</property> <property name="targetFileType">report-design</property> <list-property name="visibility"> <property name="contentType">html</property> <text-property name="content"><![CDATA[<a href="" onclick="reportName=review-agent-by-policy.rptdesign, producerId=<VALUE-OF>params["ProducerId"]</VALUE-OF>, reportPeriod=<VALUE-OF>row["REPORTPERIOD"]</VALUE-OF>; runReport(reportName, producerId, reportPeriod);">Drill Down</a>]]> </text-property> </list-property> </structure> </label>

I am trying to create hyperlink that when click will call my javascript function defined in the same Master report as below:
`<?xml version="1.0" encoding="UTF-8"?>

Eclipse BIRT Designer Version 2.2.2.r222_v20071226 Build <2.2.2.v20080227-1131>
in
Copyright (c) 2007 <<Your Company Name here>>
Creates a listing report with fields from the data source.
Simple Listing
/templates/simple_listing.gif
org.eclipse.birt.report.designer.ui.cheatsheet.simplelisting
html
<![CDATA[

function runReport(reportName, producerId, reportPeriod)
{
var jsonObject = {};
var selIndex = obj.selectedIndex;
var balance = obj.options[selIndex].text;
jsonObject["__report"] = reportName;
jsonObject["ProducerId"] = producerId;
jsonObject["ReportPeriod"] = reportPeriod;
windowOpenUsingPOST('birt-viewer/frameset', jsonObject);
}
</script>]]></text-property>`

My issue is first of all the link itself is not appearing as below screen shot:

it should look like below:

and also is my code correct to call the javascript passing correct parameters.

Answers

  • jfranken
    edited March 8, 2018 #2

    There is built-in functionality to drill-through to a second report:

    Select the element you want to turn into a link.
    Select the Properties tab and choose the Hyperlink sub-tab.
    Click Edit and choose the "Drill-through" hyperlink type in the Hyperlink editor.

    It is possible to write your own code instead of using the method provided. If you cannot use this method, please explain why it won't work so I can better understand what you are trying to do.

    Warning No formatter is installed for the format ipb
  • Hyperlink from Birt report designer works fine, issue with that it exposes URL parameters, and I don't want to expose those in the URL and hence I am using Post URL. Is there any way in Birt designer to create hyperlink but with POST url

  • jfranken
    edited March 8, 2018 #4

    Attached are two reports that illustrate how to drill-through using the POST method. The reports were created in the Pro designer, version 16.

    First open postParent,rtpdesign in the designer and edit the top text element. Modify the code changing the path near the top to point to the location where you placed postChild,rptdesign on your machine. Run postParent and click one of the links. The child report will be run and it will show the parameter values were passed via the POST method.

    Warning No formatter is installed for the format ipb