Jump to content
We've recently updated our Privacy Statement, available here ×

How can we consume single query in multiple tables


VimMang

Recommended Posts

My requirement is  to build report with two tables - one table contains all detail data and other table contain summary data. To achieve this what needs to be done? Does it needs to create two dataset? Can I consume single query in the both tables?

Generally in SSRS , This can be done in single query to consume in one or more tables.

Thanks in Advance.

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Thanks It worked.  I see query executed multiple times.. Having said that I created a report with one dataset and with 3 tables. These tables are referred dataset query. When I checked database logs, It showed me dataset query executed three times before of it referred via three tables.

One more question, How can I add filter condition on table level? Lets say I have to define query on dataset level and requirement would be as below

1. Create two tables- first table should show all the rows from sql query.

2. In second table - It should show based on some condition. lets say date <= today

Thanks in Advance.

 

 

 

 

Link to comment
Share on other sites

Thanks for response. Let's say as an example – DB table contains hundred records with Id and description. In first table have to display first 20 records (Id <=20) and in other table have to display next ( Id between 21 and  40) . How can I achieve this? Where do I need to use conditional filter to show selected data in table?

 

 

Link to comment
Share on other sites

Your example clarrifies your requirement. Ignore my previous answer.
What I finally understand is that you want to display first 20 records in table 1 and next 20 records in table two.

The easient way would be to have two separate datasets.

But even without that, what you can try is give all the fields of table 2, a print when condition like ;
$P{Id}>20.

In that case, all the fields of table two will only be printed as and when the ID is greater than 20.

Hope this helps,
KKriplani
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...