Showing posts with label changing. Show all posts
Showing posts with label changing. Show all posts

Thursday, March 22, 2012

Data driven subscriptions scripting

Hi,

I have a reporting environement where the same report must be sent to a long ever changing list of recipients with different parameters values for each recipient.

My idea is to use data driven subscriptions and put back the administrative responsibility of managing this where it belongs, the business.

To achieve this goal, a one stop shopping user friendly management interface should be provided.

The list of features is as follow;

- pick list for existing reports
- auto-discovery of parameters and their values
- List of existing subscriptions with add/edit /delete buttons
- management of tables content from this interface
- creation of related data driven subscriptions from this interface

Right now, I think I can tackle some of these features piece by piece and build a library of scripts till the day all pieces can fall together.

The immediate question I have is
Can I script the creation of a data driven subscription and how?
I saw one can script a regular subscription but not a data driven one.

Can I use WS to do this? Any example, guidance or thought?

Thanks,

Philippe

SSRS exposes its features to the outside world as a set of Web Service APIs. Custom applications can call to these APIs. In fact, all the requirements you mentioned are available in the Report Manager which behind the scenes calls down to the RS Web service. The CreateDataDrivenSubscription API allows you to create a data-driven expression. See the documention for an example.

Data Driven Subscription Query Parameters

Does anyone know if its possible to use report parameters as
parameters to a data driven subscription query. This would be useful
for changing the names of the files generated by the subscription
according to the parameters passed to the report.
For example, a report that takes a customer name as a parameter could
pass the customer name through to the data driven subscription query.
This would allow the customer name to be included in the file name of
the file that the data driven subscription generates.
Cheers,
David.In the parameters page, you are able to do a select statement & assign
parameters based on that.
So you could do a select * From names
Assuming your names table has a name field, then you could use the name &
field to assign it to a "file name".
"David Evans" wrote:
> Does anyone know if its possible to use report parameters as
> parameters to a data driven subscription query. This would be useful
> for changing the names of the files generated by the subscription
> according to the parameters passed to the report.
> For example, a report that takes a customer name as a parameter could
> pass the customer name through to the data driven subscription query.
> This would allow the customer name to be included in the file name of
> the file that the data driven subscription generates.
> Cheers,
> David.
>|||Yes, I know you can obtain the file name from a database query for a
data driven subscription. What I dont know is whether you can change
the file name based on the value of a report parameter.
Say I had a report with a parameter of customer name. If someone
created a data driven subscription and specified a customer of
customer1 for the customer name. I would like to be able to generate a
file name like "customer1_09-11-2004.csv".
I guess you would need to pass the customer name as the where clause
to the "select * from names" query mentioned below.
Is this possible.
Cheers,
David.
"mresanchez" <mresanchez@.donot-spam.com> wrote in message news:<1D9F5CAA-3EFD-4747-9455-F51DB8016FEF@.microsoft.com>...
> In the parameters page, you are able to do a select statement & assign
> parameters based on that.
> So you could do a select * From names
> Assuming your names table has a name field, then you could use the name &
> field to assign it to a "file name".
> "David Evans" wrote:
> > Does anyone know if its possible to use report parameters as
> > parameters to a data driven subscription query. This would be useful
> > for changing the names of the files generated by the subscription
> > according to the parameters passed to the report.
> >
> > For example, a report that takes a customer name as a parameter could
> > pass the customer name through to the data driven subscription query.
> > This would allow the customer name to be included in the file name of
> > the file that the data driven subscription generates.
> >
> > Cheers,
> >
> > David.
> >