Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Crossing DataSets?

Author  Topic 

abssinto
Starting Member

1 Post

Posted - 2007-04-05 : 04:24:47
Hi everyone.

I recently start learning about SSRS, I wonder if you can tell me if there’s a way to cross information with deferent’s datasets.

For example if in one dataset I have the result of table A, B, C, and in other dataset I have the result of A, D, E, can I make one table grouped by A resulting A - B, C, D ,E?

Or I have to do the cross in another dataset and display it in one table.

Thanks for your time.

jhermiz

3564 Posts

Posted - 2007-04-05 : 14:12:35
quote:
Originally posted by abssinto

Hi everyone.

I recently start learning about SSRS, I wonder if you can tell me if there’s a way to cross information with deferent’s datasets.

For example if in one dataset I have the result of table A, B, C, and in other dataset I have the result of A, D, E, can I make one table grouped by A resulting A - B, C, D ,E?

Or I have to do the cross in another dataset and display it in one table.

Thanks for your time.



A dataset is simply a source to a procedure, that is all period. Whatever you can do in a sproc you can do in a dataset, because that dataset is that sproc. If you can have 100 tables joined in a sproc and produce meaningful data then you can create a datasource with that sproc.

To answer your question, yes anything is possible. Stop thinking in terms of a dataset as something very complex and will it do this or will it do that. Whatever you can do to create a procedure / function which contains 'n' tables you can use that dataset as your report.

Ideally each parameter should be a dataset in your report, and finally you should have one last dataset as your main report.
Consider the following, I usually like to have 'n' datasets based on 'n' parameters.

If I for instance have to write a dealership report and I deal with vehicles.

Then I have one dataset for Makes:

SELECT make FROM myMakes

this returns GM, Ford, Chrysler, Honda, Toyota, etc.

Then i have another dataset for models

Select Model From myModels WHERE Make = @make

This returns the models of a specific make.

now you have the parameters done, so you need one more dataset for the actual report. This dataset is generally larger than your previous ones because it may include fields from other tables.

So you create a sproc and do your joins and use that as your dataset. You can include grouping directly at the stored procedure layer or even within a report by creating a group.

Good luck.



Programmers HowTo's -- [url]http://jhermiz.googlepages.com[/url]
Go to Top of Page
   

- Advertisement -