BIRT Exchange Forum: Binding multiple datasets to table - BIRT Exchange Forum

Jump to content


 

No Latest Open Poll.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Binding multiple datasets to table Rate Topic: -----

#1 User is offline   Erebel55 Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 42
  • Joined: 01-November 11


Posted 06 June 2012 - 12:54 PM

Birt 2.6.1

Is there a way to bind multiple datasets to a grid or table? So far I can only figure out how to bind one.
0

#2 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12971
  • Joined: 16-May 08


Posted 06 June 2012 - 01:11 PM

You can only bind one dataSet to a table. The ways around this are to either join your two dataSets into one, then bind that dataSet to the table, or to embed elements from the second dataSet into your table and use a filter or dataSet parameter bindings to limit the data for the embedded element.
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
1

#3 User is offline   Erebel55 Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 42
  • Joined: 01-November 11


Posted 06 June 2012 - 02:14 PM

Thank you :)

By the way what I was trying to do was add the values of two columns from two separate dataSets but I guess I can use a join dataSet and a computed column.
0

#4 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12971
  • Joined: 16-May 08


Posted 07 June 2012 - 07:57 AM

Yeah. You could do that or you could use global variables. If the joint dataSet works without taking too much extra time, great. If not, let me know, maybe we can do something else. :)
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#5 User is offline   Erebel55 Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 42
  • Joined: 01-November 11


Posted 07 June 2012 - 05:52 PM

Well the joint dataset idea had to be trashed because i ended up having to add up 3 data items from 3 different datasets. So what I did was create a dataset that unioned the 3 values that I needed and then binded that to the grid. Not a very pretty way..but I am very interested in hearing about global variables.

Thank you.
0

#6 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12971
  • Joined: 16-May 08


Posted 12 June 2012 - 08:58 AM

Sorry for the delay. If you just need to add a couple or few values from different dataSets, you can set the value you need from each dataSet to a reportContext.setGlobalVariable("varName","value");, then, recall those global variables where you need them, for your calculation. If you show me some sample data and what you want your final result to be, I'll make you a quick sample.
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#7 User is offline   gkjann Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-July 12


Posted 13 July 2012 - 12:13 PM

View Postmwilliams, on 12 June 2012 - 08:58 AM, said:

Sorry for the delay. If you just need to add a couple or few values from different dataSets, you can set the value you need from each dataSet to a reportContext.setGlobalVariable("varName","value");, then, recall those global variables where you need them, for your calculation. If you show me some sample data and what you want your final result to be, I'll make you a quick sample.


Hi,

I have the following scenario:

I am using a flat file data source and don't have the ability to join the data sets.

Dataset1: Field: Signer_Name - has EMP ID
Dataset2: Fields: EMP ID, EMP NAME, EMP EMAIL.

I have a need to read the EMP ID (Multiple values) and then display the results for the EMP from the Dataset2. I was able to do this on the report designer using the Nested Tables, but the realtime report takes a lot of time to generate and sometime times out. Is there a way that I can read values from Dataset1 into a Global Variable and then display the matching EMP details from Dataset2 ?


Any suggestions will be greatly appreciated.
0

#8 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12971
  • Joined: 16-May 08


Posted 16 July 2012 - 07:08 PM

Can you show me a few lines of data from each dataSet and also what you want the output to look like? Also, let me know your BIRT version and I'll make you an example.
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#9 User is offline   gkjann Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-July 12


Posted 17 July 2012 - 06:20 AM

Dataset1: Field: Signer_Name - has EMP ID ( like 5 digit numbers), Sign_Date - Date and time Stamp.

Dataset1:

Signer_Name, Sign_date
11111, 1/1/2012 10:00:00 AM
11112, 1/20/2012 10:00:00 AM
11233, 10/11/2012 11:00:00 AM

Dataset2:

EMP ID, EMP NAME, EMP EMAIL
11111, TOM CRUSE, Tom_Cruse@gmail.com
11233, Mike Tyndal, Mike@gmail.com

The Dataset1 is being derived from one business process (Employee Signature on purchase orders) and the Dataset2 is being derived from a different business process (Full Company Employee Dataset).

Other fields in the Dataset1:

Order_number, Order_desc, Order_date, Vendor_ID.

My expectation is that when the report is run, it picks up the order details and in the signature details (Table), I want to display the EMP_NAME and EMP_EMAIL by looking at the EMP ID from Dataset2 and Corresponding value if available from Signer_Name in dataset1.

Output:

Signer Name, Signer Email, Signature Date
EMP_NAME, EMP_EMAIL, SIGN_DATE
TOM CRUSE, Tom_Cruse@gmail.com, 1/1/2012 10:00:00 AM
Mike Tyndal, Mike@gmail.com, 10/11/2012 11:00:00 AM

I hope I was able to provide all the information that you asked for.


Thank you
0

#10 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12971
  • Joined: 16-May 08


Posted 17 July 2012 - 09:40 AM

Here's an example where the name and email are stored in arrays in the onFetch of the customer directory, then accessed in the purchases table by using the id field. Take a look. You can also do the same with persistentGlobalVariables, if you'd like. As I put the name and email in the employee id slot of the array, you can name your global variables after the employee id, so you can easily access the correct values. This design was made in BIRT 3.7. Let me know if you have questions.

Attached File(s)


Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#11 User is offline   gkjann Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-July 12


Posted 20 July 2012 - 08:49 AM

Hi,

THANKS A LOT FOR THE QUICK HELP. I was able to get the code to work with my need. The response time is great.

Thank you,

G
0

#12 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12971
  • Joined: 16-May 08


Posted 20 July 2012 - 09:26 AM

You're very welcome! Let us know whenever you have questions! :)
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users