Friday, March 9, 2012

Possible to reuse the same SQL dataset in many reports?

Is it possible to create a SQL query and hook this up to more than one
report? I have several reports that are supposed to be standardized to be
deployed to different clients. We want to brand the reports with each
client's name. We can get the name from the SQL Server database that the
reports are using.
Is it possible to just create this dataset "somewhere" in my report project,
and have all reports get the data returned from this dataset? Or do I have
to add this dataset to all my reports?
Sincerely,
Kaisa M. Lindahlyou can do this by using a stored procedure
"Kaisa M. Lindahl" wrote:
> Is it possible to create a SQL query and hook this up to more than one
> report? I have several reports that are supposed to be standardized to be
> deployed to different clients. We want to brand the reports with each
> client's name. We can get the name from the SQL Server database that the
> reports are using.
> Is it possible to just create this dataset "somewhere" in my report project,
> and have all reports get the data returned from this dataset? Or do I have
> to add this dataset to all my reports?
> Sincerely,
> Kaisa M. Lindahl
>
>|||I found that the best way is to put all or most of your query into a stored
procedure or in-line table function on the server so it is easily accessible
from other reports.
"Kaisa M. Lindahl" wrote:
> Is it possible to create a SQL query and hook this up to more than one
> report? I have several reports that are supposed to be standardized to be
> deployed to different clients. We want to brand the reports with each
> client's name. We can get the name from the SQL Server database that the
> reports are using.
> Is it possible to just create this dataset "somewhere" in my report project,
> and have all reports get the data returned from this dataset? Or do I have
> to add this dataset to all my reports?
> Sincerely,
> Kaisa M. Lindahl
>
>|||DavidK or Antoon or someone else:
Can you please explain how to do it? I've looked at articles on the internet
and the "Hitchhiker's" book, and I can't figure out how to use Stored
Procedures properly.
I've managed to create a stored procedure. Unfortunately, this has to be a
sp with dynamic sql. It takes 2 parameters. When I'm testing it, it works
OK, but it doesn't return any fields. So none of the results show up in the
report at all.
Any clues, please? A short explanation or links to resources on the web is
OK. :)
Sincerely,
Kaisa
"DavidK" <DavidK@.discussions.microsoft.com> wrote in message
news:649C3B02-DA26-42EA-8F4E-FD3EB1D15361@.microsoft.com...
>I found that the best way is to put all or most of your query into a stored
> procedure or in-line table function on the server so it is easily
> accessible
> from other reports.
> "Kaisa M. Lindahl" wrote:
>> Is it possible to create a SQL query and hook this up to more than one
>> report? I have several reports that are supposed to be standardized to be
>> deployed to different clients. We want to brand the reports with each
>> client's name. We can get the name from the SQL Server database that the
>> reports are using.
>> Is it possible to just create this dataset "somewhere" in my report
>> project,
>> and have all reports get the data returned from this dataset? Or do I
>> have
>> to add this dataset to all my reports?
>> Sincerely,
>> Kaisa M. Lindahl
>>|||Although u create a Stored Procedure , u need to have a dataset in all
your reports which point to the stored procedure.
In short for every report there shall be a dataset|||"Vishu" <vishwasaj@.gmail.com> wrote in message
news:1121329763.408325.84730@.g43g2000cwa.googlegroups.com...
> Although u create a Stored Procedure , u need to have a dataset in all
> your reports which point to the stored procedure.
> In short for every report there shall be a dataset
Thanks. :)
I recreated the Stored Procedure without parameters. The SP needs to be
added manually to each database anyway, so I will change it to fit with the
database in the stored procedure, not have each report send the parameters.
Adding just one line of code as a dataset + adding a text box to the report
was a lot easier than expected.
In the end I wrote a blog post about it:
http://blogs.spipp.net/kaisa/archive/2005/07/12/1154.aspx
Kaisa M. Lindahl

No comments:

Post a Comment