Nested Table Name field value from Parent [message #821631] |
Thu, 15 March 2012 16:15 |
Peter Brown Messages: 7 Registered: March 2012 |
Junior Member |
|
|
Hello,
[Eclipse 3.7.1
linux 64bit
BIRT Framework 3.7.2 v20120213]
Newbie to BIRT (coming from iReport).
I have been scouring the examples and web for a solution to the following:
Goal:
Primary Data Set:
select Abbr FROM Company_Master;
Secondary Data Set:
select Field1, Field2, Field3 FROM Abbr_Accounts, Abbr_Tran
Tried:
Secondary Data Set using Parameters:
manuf (String, Default "ABC", Linked to Report Param - None)
Secondary Data Set:
select Field1, Field2, Field3 FROM ?_Accounts
Master table row in layout:
Expression builder:
abbr = dataSetRow["Abbr"];
dataSetRow["Abbr"]
Secondary Table Data Set Parameter bindings
manuf (String, abbr)
Error: mysql...right syntax to use near ''ABC'_Accounts....'
[I don't want to have to enter multiple params for Company Abbr as this could mean many params with same value so I hope the below string holder will work...]
Alter SQL:
If I try a string holder in the Data Set Query ':abbr' (keeping parameter manuf) and (clicking on nested data set) and then Designer Script -> beforeOpen
this.queryText = this.queryText.replaceAll(':abbr', params["manuf"])
Error: Report parameter manuf does not exist.
this.queryText = this.queryText.replaceAll(':abbr', abbr);
Error: 'Cannot set the string value (AFS) to parameter 1.' and 'SQL error #1:Parameter index out of range (1 > number of parameters, which is 0).'
Remove manuf parameter from secondary data set.
this.queryText = this.queryText.replaceAll(':abbr', abbr);
Error: mysql...right syntax to use near ''ABC'_Accounts....'
Two different tries based on what I could google and I still can't get rid of the ''.
Any help much appreciated.
Thank you,
|
|
|
|
Re: Nested Table Name field value from Parent [message #821803 is a reply to message #821746] |
Thu, 15 March 2012 21:00 |
|
So you have it working?
Jason
On 3/15/2012 3:24 PM, Peter Brown wrote:
> ID10T Error....
>
> string holder in Data Set Query should be :abbr and not ':abbr' if using
> this.queryText = this.queryText.replaceAll(':abbr', params["manuf"]).
>
> as is should have used this.queryText.replaceAll('\':abbr\'',
> params["manuf"]).
|
|
|
|
|
|
Re: Nested Table Name field value from Parent [message #824409 is a reply to message #822541] |
Mon, 19 March 2012 16:28 |
|
Thanks for the update.
Jason
On 3/16/2012 5:42 PM, Peter Brown wrote:
> P.S. If you have to go back to the Data Set to edit you can change the
> abbr to a hard coded value e.g. 'ABC' (this.queryText =
> this.queryText.replaceAll('\':abbr\'', abbr) and you won't get any
> errors while you work in the Data Set. Then change it back to run preview.
|
|
|
Powered by
FUDForum. Page generated in 0.03112 seconds