dynamic parameter name [message #258451] |
Tue, 16 October 2007 08:39  |
Eclipse User |
|
|
|
Originally posted by: rwojtowicz.dfqs.pl
Hello,
In my report I have Dynamis parameter, which gets values from SQL:
SELECT id, name
FROM MyTable
and I use 'id' as value and 'name' as display name. Now I want to use this
display name in my report. How can I do this?
Thanks,
|
|
|
|
Re: dynamic parameter name [message #258705 is a reply to message #258464] |
Thu, 18 October 2007 10:22   |
Eclipse User |
|
|
|
Originally posted by: rwojtowicz.dfqs.pl
Hi Nikolaus,
Well, I don't think you understood my question :-)
I've got all this working just like you said. For example:
When displaying my finished report, I picked a parameter from parameter
window. I picked it from the listbox, chose the name of the City, but I
really chose the hidden City's ID. Now I've got report with values
regarding this City. But how can I get a city name in the header of my
report without querying the database again?
When i use dynamic text element with parameter["city"], i Get city's ID,
but still don't have the name
Nikolaus wrote:
> Hi Rafal,
> if I well understood your question, you should create a report parameter.
> In "List of value" choose "Dynamic" then choose your existing dataset
> from the combo and give value to "Value column" (it's the value your
> parameter is going to be assigned) and "Display text" (it's what you see
> in the combo.
> If you need to display more info you can append them.
> Example:
> dataSetRow["aaa"] + ' ' + dataSetRow["bbb"] + ....... and so on
> Bye
> nico
> Rafal Wojtowicz ha scritto:
>> Hello,
>> In my report I have Dynamis parameter, which gets values from SQL:
>>
>> SELECT id, name
>> FROM MyTable
>>
>> and I use 'id' as value and 'name' as display name. Now I want to use
>> this display name in my report. How can I do this?
>>
>> Thanks,
>>
|
|
|
|
|
Re: dynamic parameter name [message #259265 is a reply to message #259110] |
Wed, 24 October 2007 07:05   |
Eclipse User |
|
|
|
Originally posted by: rwojtowicz.dfqs.pl
Scott,
thanks for your answer. But I mean something other than just displaying
the parameter's value:
1. My Parameter is DYNAMIC (from dataset, one column has the id as value
and second has name as 'display name' into parameter window)
2. I want to show in my report the "display name", not the "value column"
Scott Rosenbaum wrote:
> Rafal,
> If you want to display a parameter in a Data Control, you should be able
> to do that with the expression builder. The expression will look like:
> params["paramToDisplay"]
> Here is a report that takes a parameter and displays it in the report.
> <?xml version="1.0" encoding="UTF-8"?>
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version
2.2.1.r221_v20070924
> Build <2.2.0.v20070924-1550></property>
> <property name="units">in</property>
> <property name="comments">Copyright (c) 2007 Innovent Solutions,
Inc.</property>
> <html-property name="description">Creates a blank report with no
predefined
> content.</html-property>
> <text-property name="displayName">Blank Report</text-property>
> <property name="iconFile">/templates/blank_report.gif</property>
> <parameters>
> <scalar-parameter name="paramToDisplay" id="7">
> <property name="valueType">static</property>
> <property name="dataType">string</property>
> <property name="paramType">simple</property>
> <text-property name="promptText">What do you want to
display</text-property>
> <property name="controlType">text-box</property>
> <property name="defaultValue">This is the default text</property>
> <property name="distinct">true</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> </parameters>
> <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="8">
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">Column Binding</property>
> <expression
name="expression">params["paramToDisplay"]</expression>
> <property name="dataType">any</property>
> </structure>
> </list-property>
> <property name="resultSetColumn">Column Binding</property>
> </data>
> </body>
> </report>
>> Nikolaus wrote:
>>
>>> Hi Rafal,
>>> if I well understood your question, you should create a report
>>> parameter.
>>> In "List of value" choose "Dynamic" then choose your existing dataset
>>> from the combo and give value to "Value column" (it's the value your
>>> parameter is going to be assigned) and "Display text" (it's what you
>>> see
>>> in the combo.
>> That's exactly want I want to achieve: to see this picked "Display
>> text" in my report, not just in the parameter window. Anyone?
>>
|
|
|
|
Re: dynamic parameter name [message #259397 is a reply to message #259331] |
Thu, 25 October 2007 02:41  |
Eclipse User |
|
|
|
Originally posted by: rwojtowicz.dfqs.pl
Thank you very much, finally I've got it working :)
Scott Rosenbaum wrote:
> Rafal,
> Sorry for the misunderstanding. I have reworked and re-attached the report.
> The expression is:
> reportContext.getParameterDisplayText("paramToDisplay")
> Scott Rosenbaum
|
|
|
Powered by
FUDForum. Page generated in 0.04623 seconds