Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Problem in passing query string parameters from HTML to BIRT(Problem in passing query string parameters from HTML to BIRT)
Problem in passing query string parameters from HTML to BIRT [message #1003896] Tue, 22 January 2013 07:51 Go to next message
Saroj Suaro is currently offline Saroj SuaroFriend
Messages: 2
Registered: January 2013
Junior Member
Hi,

I have a HTML external to BIRT deployment which has following:

	<table id="graphid">
	<tr>
		<td>
			<b>Choose Parameters:</b>
		</td>
		<!--<td>
			<input type="hidden" name="__report" value="DynamicRpt.rptdesign" />
		</td> -->
		<td>
			<SELECT NAME="choiceX" id="choiceX">
					<OPTION VALUE="Country">Country
					<OPTION VALUE="Platform">ApplicationPlatform
					<OPTION VALUE="Application">Application
					<OPTION VALUE="Team">SponsoringBU
			</SELECT>
		</td>
		<td>
			<SELECT NAME="choiceY" id="choiceY">
					<OPTION VALUE="Count">ByCount
					<OPTION VALUE="Percentage">ByPercentage					
			</SELECT>
		</td>
		<td style="padding-left: 3em">
			<b>Choose A Graph Type:</b>			
		</td>
		<td>
			<SELECT NAME="graphType" id="graphType">
					<OPTION VALUE="Bar">BarChart
					<OPTION VALUE="Line">LineChart					
			</SELECT>
		</td>
	</tr>	
	<tr>		
		<td>
			<a href="#" onclick="showGraphData();">Draw Graph</a> 
			<!-- <input type="submit" value="Draw Graph"/> --> 
		</td>		
	</tr>
	</table>


	<table>
	<tr>
		<td>
			<iframe id="show_graph" name="show_graph" height="500px" width="950px" scrolling="no" frameborder="0" style="display:block"></iframe>
		</td>
	</tr>
	</table>


In the Javascript function in above HTML, I have following:

<SCRIPT language="JavaScript">
function showGraphData(){
	var theDivGraphData = document.getElementById('show_graph');
	var theDivX = document.getElementById('choiceX');	
	var theDivY = document.getElementById('choiceY');
	var graphType = document.getElementById('graphType');
	var x = theDivX.options[theDivX.selectedIndex].value+","+theDivY.options[theDivY.selectedIndex].value+","+graphType.options[graphType.selectedIndex].value;

	var graphURL = "/Birt/run?__report=DynamicRpt.rptdesign"+"&choice="+x;
	theDivGraphData.src = graphURL;
}
</SCRIPT>


In the beforeOpen of the Data Set, I have following:

var y = params["choice"];
var z = y.split(',');

if (z[0] == "Country" && z[1] == "Count" && z[2] == "Bar"){ 
	this.queryText = "";
}else{ 
	this.queryText = "";
}


I only want to check if the HTML user selected attributes are passed successfully to BIRT script or not but I'm getting below exception:

The following items have errors:

ReportDesign (id = 1):
+ There are errors evaluating script "var y = params["choice"];
var z = y.split(',');

if (z[0] == "Country" && z[1] == "Count" && z[2] == "Bar"){ 
 this.queryText = "";
}else{ 
 this.queryText = "";
} 

":
Fail to execute script in function __bm_beforeOpen(). Source:
------
" + var y = params["choice"];
var z = y.split(',');

if (z[0] == "Country" && z[1] == "Count" && z[2] == "Bar"){ 
 this.queryText = "";
}else{ 
 this.queryText = "";
} 

 + "
-----
A BIRT exception occurred. See next exception for more information.
Error evaluating Javascript expression. Script engine error: Report parameter "choice" does not exist.
 Script source: /report/data-sets/oda-data-set[@id="8"]/method[@name="beforeOpen"], line: 0, text:
__bm_beforeOpen(). (Element ID:1)


Please help to suggest what am I doing wrong here. It says Report parameter "choice" does not exist. which is true as I'm passing the parameter thru query string URL.

Thanks,
Saroj
Re: Problem in passing query string parameters from HTML to BIRT [message #1004056 is a reply to message #1003896] Tue, 22 January 2013 14:01 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

There is a separate Eclipse forum for BIRT issues.
Previous Topic:Maven Installation problems
Next Topic:Eclipse .project problem
Goto Forum:
  


Current Time: Tue Apr 30 20:18:19 GMT 2024

Powered by FUDForum. Page generated in 0.06682 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top