Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » show display text of dynamic parameter on report
show display text of dynamic parameter on report [message #144781] Thu, 16 March 2006 21:58 Go to next message
Eclipse UserFriend
Originally posted by: vladperl.semanticprogrammer.org

I have dynamic parameter called "departmentID" that get value (id) from
dataset "departments".
Dataset "departments" use query: "select id, name from Departments".
How can I get department name from selected row of "departments" dataset?
I need to present name of department on report .

Thank you,
Vladimir
Re: show display text of dynamic parameter on report [message #144848 is a reply to message #144781] Fri, 17 March 2006 00:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: David.Peterson.mtvnmix.com

I'm not totally sure what you're asking, but I think you just want to create
the parameter as a dynamic combo box with ID and name, then you can access
directly as

params["Name"]
Re: show display text of dynamic parameter on report [message #145412 is a reply to message #144848] Fri, 17 March 2006 15:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vladperl.semanticprogrammer.org

Hi David,
Thank you for response.
> I'm not totally sure what you're asking, but I think you just want to
> create the parameter as a dynamic combo box with ID and name, then you can
> access directly as
>
> params["Name"]

I have tried that. It doesn't work.

Here is my parameter:
<scalar-parameter name="departmentID" id="11">

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

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

<property name="promptText">Department</property>

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

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

<property name="dataSetName">departments</property>

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

<expression name="labelExpr">row["Name"]</expression>

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

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

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

</scalar-parameter>

------------------------------------------------------------ -

here is "departments" DataSet:



<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="departments" id="6">

<property name="dataSource">midwood</property>

<property name="queryText">select ID, Name

from dbo.Department

order by name</property>

</oda-data-set>



I need to show selected department name.

Thank you,

Vladimir
Re: show display text of dynamic parameter on report [message #145539 is a reply to message #145412] Fri, 17 March 2006 18:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: David.Peterson.mtvnmix.com

<I need to show selected department name.>


I see what you're asking now. The parameter is really the department id.
You don't really have a handle to the combo parameter 'name' part. You have
params["department-id"], but nothing for params["department-name"] as it's
displayed to the user, but it isn't a param per se.

What I do is a bit different. I use the DepartmentID to index into my
departments table to return a dataset for my report. As part of that, I
also return the department-name in dataset query even though I may not
actually need it for the report. Then I display that in my report header as
row["department-name"]. Will this work for you?

So what I have is actually two datasets:

1. dataset departments which is used to form the parameter with query:
select ID, Name from dbo.Department order by name.

2. dataset department which is used in my actual report with query: select
ID, Name from dbo.Department where ID=? <bound to parameter DepartmentID>
and used to display the department name in my report.

is this clear?
Re: show display text of dynamic parameter on report [message #145582 is a reply to message #145539] Fri, 17 March 2006 18:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vladperl.semanticprogrammer.org

> I see what you're asking now. The parameter is really the department id.
> You don't really have a handle to the combo parameter 'name' part. You
> have params["department-id"], but nothing for params["department-name"] as
> it's displayed to the user, but it isn't a param per se.
>
> What I do is a bit different. I use the DepartmentID to index into my
> departments table to return a dataset for my report. As part of that, I
> also return the department-name in dataset query even though I may not
> actually need it for the report. Then I display that in my report header
> as row["department-name"]. Will this work for you?
>
> So what I have is actually two datasets:
>
> 1. dataset departments which is used to form the parameter with query:
> select ID, Name from dbo.Department order by name.
>
> 2. dataset department which is used in my actual report with query:
> select ID, Name from dbo.Department where ID=? <bound to parameter
> DepartmentID> and used to display the department name in my report.
>
> is this clear?

Yes it's clear. In fact I use the same approach as you.
Only instead of second query I'm using "getDepartmentByID" stored procedure
with related parameter.
But it doesn't look for me as elegant solution.
We have to use additional dataset and additional report item such as table
with additional parameter bounding just to work out the issue.
I have suggestion to file enhancement. What do you think?
In case you agree with me on this, please make enhancement.
I will add comments later to show them it's not just one developer who need
that enhancement.

Thank you,
Vladimir
Re: show display text of dynamic parameter on report [message #145643 is a reply to message #145582] Fri, 17 March 2006 19:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: David.Peterson.mtvnmix.com

Given all the things that I need from Birt, the lack of elegance isn't a big
issue with me. Combined datasets is a much bigger issue for me.
Re: show display text of dynamic parameter on report [message #145730 is a reply to message #145643] Fri, 17 March 2006 21:42 Go to previous message
Vladimir is currently offline VladimirFriend
Messages: 25
Registered: July 2009
Junior Member
David Peterson wrote:

> Given all the things that I need from Birt, the lack of elegance isn't a big
> issue with me. Combined datasets is a much bigger issue for me.

I have filed enhancement:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=132401
In case you are interesting to get updated on this issue put your e-mail
address there.
Previous Topic:Sybase Stored Proc Issue
Next Topic:getting objects from the session
Goto Forum:
  


Current Time: Sat Aug 24 00:32:39 GMT 2024

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

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

Back to the top