Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Parameter that decides wich table show
Parameter that decides wich table show [message #704506] Thu, 28 July 2011 18:01 Go to next message
josete4ever is currently offline josete4everFriend
Messages: 2
Registered: July 2011
Junior Member
Hello BIRT comunity,

I'm quite new into BIRT; I am developing a report that shows the content of a database table which is selected by a parameter in a previous JSP page.

I have modified the "this.queryText" within the beforeOpen event in the dataset ( this.queryText.replace("TABLENAME",parms["MYPARAMETER"].value)") And I just get the data I really want from the table I selected, but I don't know how to "print it" into the report, if I just draw a table within the layout view I got the following message

Column binding "CUSTOMERNUMBER" has referred to a data set column "CUSTOMERNUMBER" which does not exist. (Element ID:967)

because the name of the columns do not match with the name of the supossed table I selected (for example ORDERS)

I also tried to change the column data binding expression like this

if (parms["MYPARAMETER"] =table1)
{
setDataRow["Rowoftable1"]
}

if (parms["MYPARAMETER"] =table2)
{
setDataRow["Rowoftable2"]
}

but It doesn't work neither


So, in a nutshell, how can I show in a table the content of a "parametrized DataSet" wich I don't know the name of the columns in advance ?

Thank you very much

Re: Parameter that decides wich table show [message #704570 is a reply to message #704506] Thu, 28 July 2011 19:32 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

If you have a small number of tables then why not add them all and then
name them. Then in the beforeFactory drop the ones you do not need.

reportContext.getDesignHandle().findElement("mytable1" ).drop();

This is simpler than calling the de api to change a tables bindings.

Jason

On 7/28/2011 2:01 PM, josete4ever wrote:
> Hello BIRT comunity,
> I'm quite new into BIRT; I am developing a report that shows the content
> of a database table which is selected by a parameter in a previous JSP
> page.
> I have modified the "this.queryText" within the beforeOpen event in the
> dataset (
> this.queryText.replace("TABLENAME",parms["MYPARAMETER"].value)") And I
> just get the data I really want from the table I selected, but I don't
> know how to "print it" into the report, if I just draw a table within
> the layout view I got the following message
>
> Column binding "CUSTOMERNUMBER" has referred to a data set column
> "CUSTOMERNUMBER" which does not exist. (Element ID:967)
>
> because the name of the columns do not match with the name of the
> supossed table I selected (for example ORDERS)
> I also tried to change the column data binding expression like this
>
> if (parms["MYPARAMETER"] =table1)
> {
> setDataRow["Rowoftable1"]
> }
>
> if (parms["MYPARAMETER"] =table2)
> {
> setDataRow["Rowoftable2"]
> }
>
> but It doesn't work neither
>
>
> So, in a nutshell, how can I show in a table the content of a
> "parametrized DataSet" wich I don't know the name of the columns in
> advance ?
> Thank you very much
>
>
Re: Parameter that decides wich table show [message #705249 is a reply to message #704570] Fri, 29 July 2011 16:08 Go to previous messageGo to next message
josete4ever is currently offline josete4everFriend
Messages: 2
Registered: July 2011
Junior Member
Thanks for your response, at the end of the day what i did is to change the expression for visibility of some tables in the report like this:

Visible if ---> params["TableName"].value != "ParameterTableName"

Embarrassed

Thank for your response.
Re: Parameter that decides wich table show [message #705261 is a reply to message #705249] Fri, 29 July 2011 16:16 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Sounds good, but remember hidden tables still run queries.

Jason

On 7/29/2011 12:08 PM, josete4ever wrote:
> Thanks for your response, at the end of the day what i did is to change
> the expression for visibility of some tables in the report like this:
> Visible if ---> params["TableName"].value != "ParameterTableName"
>
> :blush:
> Thank for your response.
Re: Parameter that decides wich table show [message #709147 is a reply to message #705249] Wed, 03 August 2011 15:01 Go to previous message
M P is currently offline M PFriend
Messages: 3
Registered: June 2011
Junior Member
I soved above problem by removing alias from the Query !!

like insted of SELECT v.name as newname FROM table; just use
SELECT v.name FROM table; Alias is creating problem in column binding.

Also if you use birt- viewer then use preview command insted of frameset .


Previous Topic:Integrating the Report Engine to RCP plugin
Next Topic:(no subject)
Goto Forum:
  


Current Time: Sat Apr 27 04:24:00 GMT 2024

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

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

Back to the top