Skip to main content



      Home
Home » Archived » BIRT » Parameter Binding, how to understand the consept
Parameter Binding, how to understand the consept [message #179409] Fri, 21 July 2006 09:58 Go to next message
Eclipse UserFriend
Originally posted by: bjoebirk.atgat.com

I am new to Birt 2.1, and it seems that I do need a teaspoon explanation
of the report parameter function. I have tried the explanation in the
tutorial, but then I get this error:

Error evaluating Javascript expression. Script engine error:
unterminated string literal
Script source: property binding, line: 0, text:
"SELECT CustomerName From CUSTOMERS WHERE CustomerName LIKE
"+ params["CustPara"]

Do anyone have a suggestion where I can find this teaspoon explanation?
Re: Parameter Binding, how to understand the consept [message #179611 is a reply to message #179409] Mon, 24 July 2006 02:55 Go to previous message
Eclipse UserFriend
Property Binding happens at runtime.
The query is swapped out with the query you put in the property binding tab.
You can modify your example like
"SELECT CustomerName From CUSTOMERS WHERE CustomerName LIKE '" +
params["CustPara"] +"'"

And that should work.


Attached is a sample

Jason


<?xml version="1.0" encoding="UTF-8"?>

<!-- Written by Eclipse BIRT 2.0 -->

<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.2"
id="1">

<property name="createdBy">Eclipse BIRT Designer Version
2.1.0.N20060628-1351 Build &lt;20060628-1537></property>

<property name="units">in</property>

<property name="comments">Copyright (c) 2006 &lt;&lt;Your Company Name
here>></property>

<list-property name="propertyBindings">

<structure>

<property name="name">queryText</property>

<property name="id">5</property>

<expression name="value">"SELECT CustomerName From CUSTOMERS WHERE
CustomerName LIKE '" + params["CustPara"] +"'"</expression>

</structure>

<structure>

<property name="name">queryTimeOut</property>

<property name="id">5</property>

</structure>

</list-property>

<parameters>

<scalar-parameter name="CustPara" id="7">

<property name="valueType">static</property>

<property name="dataType">string</property>

<property name="controlType">text-box</property>

<property name="defaultValue">%At%</property>

<structure name="format">

<property name="category">Unformatted</property>

</structure>

</scalar-parameter>

</parameters>

<data-sources>

<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc"
name="Data Source" id="4">

<text-property name="displayName">Data Source</text-property>

<property
name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>

<property name="odaURL">jdbc:classicmodels:sampledb</property>

<property name="odaUser">ClassicModels</property>

</oda-data-source>

</data-sources>

<data-sets>

<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="Data Set" id="5">

<text-property name="displayName">Data Set</text-property>

<list-property name="resultSet">

<structure>

<property name="position">1</property>

<property name="name">CUSTOMERNAME</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

</list-property>

<structure name="cachedMetaData">

<list-property name="resultSet">

<structure>

<property name="position">1</property>

<property name="name">CUSTOMERNAME</property>

<property name="dataType">string</property>

</structure>

</list-property>

</structure>

<property name="dataSource">Data Source</property>

<property name="queryText">SELECT CustomerName From CUSTOMERS </property>

</oda-data-set>

</data-sets>

<page-setup>

<simple-master-page name="Simple MasterPage" id="2">

<page-footer>

<text id="3">

<property name="contentType">html</property>

<text-property name="content"><![CDATA[<value-of>new
Date()</value-of>]]></text-property>

</text>

</page-footer>

</simple-master-page>

</page-setup>

<body>

<data id="6">

<property name="dataSet">Data Set</property>

<list-property name="boundDataColumns">

<structure>

<property name="name">CUSTOMERNAME</property>

<expression name="expression">dataSetRow["CUSTOMERNAME"]</expression >

<property name="dataType">string</property>

</structure>

</list-property>

<property name="resultSetColumn">CUSTOMERNAME</property>

</data>

</body>

</report>

"Bj
Previous Topic:Screencam of BIRT in RCP app
Next Topic:Central european font support in pdf
Goto Forum:
  


Current Time: Thu Jul 17 20:12:29 EDT 2025

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

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

Back to the top