Skip to main content



      Home
Home » Archived » BIRT » Help with basic parameter use
Help with basic parameter use [message #158314] Thu, 04 May 2006 12:24 Go to next message
Eclipse UserFriend
Originally posted by: danny.rosenberg.weblayers.com

Hi -

We just discovered BIRT this week and are trying to convert our cewolf
reports in a ridiculously short development window. To that end, I am
trying to figure out how to use BIRT's parameter capabilities on the design
end. I want to append the parameters to the report URL in the system and
have the report change the way the data is displayed based on those
parameters. How do I bake them into the report?

Any/all help appreciated.

thx,
-d.
Re: Help with basic parameter use [message #159394 is a reply to message #158314] Tue, 09 May 2006 05:04 Go to previous message
Eclipse UserFriend
Danny,

BIRT has report parameters and data set parameters. Data Set parameters are
created in the query builder using a ? in the query and then selecting the
parameters entry in data set dialog. Report parameters are created by
selecting the Report Parameters icon on the Data Explorer view.

If you want to use parameters in the Query, first create a data set
parameter and assign it a default. This is done in the data set builder.
When you tie your data set to a table for display there will be a binding
tab on the property editor on the table.
Select the binding tab and in the far right column it will show the default
value you setup for your data set parameter. Replace this with your report
parameter by using the expression builder or typing params["myparameter"].

attached is an example

Also report parameters can be referenced in the expression builder or the
JavaScript editor as params["parametername"]

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" id="1">

<property name="createdBy">Eclipse BIRT Designer Version 2.0.1 Build
&lt;20060222-1204></property>

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

<parameters>

<scalar-parameter name="officecode" id="64">

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

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

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

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

<property name="defaultValue">2</property>

</scalar-parameter>

</parameters>

<data-sources>

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

<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">

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

<list-property name="parameters">

<structure>

<property name="name">param1</property>

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

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

<expression name="defaultValue">'1'</expression>

<property name="allowNull">true</property>

<property name="isInput">true</property>

<property name="isOutput">false</property>

</structure>

</list-property>

<property name="queryText">select *

from offices

where CLASSICMODELS.OFFICES.OFFICECODE = ?

</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>

<table id="6">

<property name="width">100%</property>

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

<list-property name="paramBindings">

<structure>

<property name="paramName">param1</property>

<expression name="expression">params["officecode"]</expression>

</structure>

</list-property>

<column id="55"/>

<column id="56"/>

<column id="57"/>

<column id="58"/>

<column id="59"/>

<column id="60"/>

<column id="61"/>

<column id="62"/>

<column id="63"/>

<header>

<row id="7">

<cell id="8">

<label id="9">

<text-property name="text">OFFICECODE</text-property>

</label>

</cell>

<cell id="10">

<label id="11">

<text-property name="text">CITY</text-property>

</label>

</cell>

<cell id="12">

<label id="13">

<text-property name="text">PHONE</text-property>

</label>

</cell>

<cell id="14">

<label id="15">

<text-property name="text">ADDRESSLINE1</text-property>

</label>

</cell>

<cell id="16">

<label id="17">

<text-property name="text">ADDRESSLINE2</text-property>

</label>

</cell>

<cell id="18">

<label id="19">

<text-property name="text">STATE</text-property>

</label>

</cell>

<cell id="20">

<label id="21">

<text-property name="text">COUNTRY</text-property>

</label>

</cell>

<cell id="22">

<label id="23">

<text-property name="text">POSTALCODE</text-property>

</label>

</cell>

<cell id="24">

<label id="25">

<text-property name="text">TERRITORY</text-property>

</label>

</cell>

</row>

</header>

<detail>

<row id="26">

<cell id="27">

<data id="28">

<expression name="valueExpr">row["OFFICECODE"]</expression>

</data>

</cell>

<cell id="29">

<data id="30">

<expression name="valueExpr">row["CITY"]</expression>

</data>

</cell>

<cell id="31">

<data id="32">

<expression name="valueExpr">row["PHONE"]</expression>

</data>

</cell>

<cell id="33">

<data id="34">

<expression name="valueExpr">row["ADDRESSLINE1"]</expression>

</data>

</cell>

<cell id="35">

<data id="36">

<expression name="valueExpr">row["ADDRESSLINE2"]</expression>

</data>

</cell>

<cell id="37">

<data id="38">

<expression name="valueExpr">row["STATE"]</expression>

</data>

</cell>

<cell id="39">

<data id="40">

<expression name="valueExpr">row["COUNTRY"]</expression>

</data>

</cell>

<cell id="41">

<data id="42">

<expression name="valueExpr">row["POSTALCODE"]</expression>

</data>

</cell>

<cell id="43">

<data id="44">

<expression name="valueExpr">row["TERRITORY"]</expression>

</data>

</cell>

</row>

</detail>

<footer>

<row id="45">

<cell id="46"/>

<cell id="47"/>

<cell id="48"/>

<cell id="49"/>

<cell id="50"/>

<cell id="51"/>

<cell id="52"/>

<cell id="53"/>

<cell id="54"/>

</row>

</footer>

</table>

</body>

</report>


"Danny Rosenberg" <danny.rosenberg@weblayers.com> wrote in message
news:e3d9rc$anf$1@utils.eclipse.org...
> Hi -
>
> We just discovered BIRT this week and are trying to convert our cewolf
> reports in a ridiculously short development window. To that end, I am
> trying to figure out how to use BIRT's parameter capabilities on the
> design end. I want to append the parameters to the report URL in the
> system and have the report change the way the data is displayed based on
> those parameters. How do I bake them into the report?
>
> Any/all help appreciated.
>
> thx,
> -d.
>
Previous Topic:Error: "Total" is not defined
Next Topic:ClassDefNotFoundError trying to load ScriptedDataSetEventHandler in RCP Applicat
Goto Forum:
  


Current Time: Mon Jul 14 12:08:42 EDT 2025

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

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

Back to the top