Discussions

Demand description
Examples of parameter template that RAQ Report provided usually include two reports (for example: report/base report: parameterReport.raq and parameterReport_arg.raq), parameter input template is a report, inquiry and presentation is another one, finally display these two report on one page through the file: showreport.jsp.
But some report users need to implement the parameter report only in one report, Does RAQ Report support this kind of requirement?
This article is going to introduce you how to cope with this demand.
Basic Thought
Create a hyperlink button in the report, trigger the onClick() event by clicking the button, then define an URL the page jumps to, and add the parameter and parameter value to the URL, implement page jump through the onClick() event.
The following are steps:
1. Connect to the demo database first and create a blank input report.
2. Add database ds2, which is used to inquire the dropdown dataset in the form, content in the dataset will be transferred as parameters, SQL statement: SELECT ORDER.ORDERID FROM ORDERS.
Input "Select Order ID" in cell A2, add an inquiry link, set the data type of cell C2 as html, input "<href='#'>inquire".
3. Set cell B2 as Editable and set its Edit style as dropdown dataset. Check the Editable property of cell B2, set its dropdown dataset as ds2 you created just now, Display Value as OrderID, Data Value as OrderID, too.
4. Add a parameter used to accept OrderID selected form cell B2. Add parameter "dingdan".
5. Add dataset ds1, which is used to inquire the order details according to OrderID, SQL statement: SELECT ORDERS.ORDERID,ORDERS.CONSIGNEE,ORDERS.SHIPPERS,ORDERS.SHIPADDRESS FROM ORDERS WHERE ORDERS.ORDERID=?.
In the parameter tab of SQL Editor, add a parameter named "dingdan", and input the report.
6. Now the report is finished, now let's add the onClick() event to cell C2. Get the display value of cell B2 in the onClick() event first, then define the URL the page jumps to. Modify showReport.jsp, add the following javascript codes:
< script language="javascript">
//Define the onClick event to cell C2
document.getElementById("report1_C2").onclick=function()
{
//get the display value with the method provided in document
var value=document.getElementById("report1_B2").innerText;
//define the URL the page jumps to, and add the parameter and parameter value to the URL
window.location="showReport.jsp?raq=baobiao.raq&dingdan="+value;
}
< /script>
7. Start tomcat built in the report IDE, preview the report in IE. Select an OrderID, then click "Inquire".
Now the problem is solved, if you meet similar demand-implement the function of parameter template within one report- again in the future, you can refer to this article to cope with it.</href='#'>

TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations technology projects - with its network of technology-specific websites, events and online magazines.