one of the requirements is that if the report takes a long time to run the user can start report processing and later
when that report is processed user can see that in his 'My reports' section,
What will be the best way to do this, my main concerns are -
1 How can I use scheduling to accomplish this.
2 How to save the report, as snappshot or what...
3. How can I find in my Web app. that report is ready or not and show a link to it.
There isn't an easy way to know how long a report will take to run if this is what you after. Other than that:
1. Sure but scheduled reports have limitations. Since they run in an unattended mode, they cannot use User!UserID and all parameters must have defaults.
2. I would see if subscribed delivery works for your users. In fact, your users can create their own subscriptions if they have the necessary rights.
3. Subscribed reports can be delivered via e-mail. You don't need to do anything. The user will automatically receive the report via e-mail.
|||
Hi Teo,
Thanks for the reply,
1 What if we are not using the User!userId in report and all other parameters are passed while creating the schedule?
one more thing is while creating the schedule using web service (CreateSchedule) we can send a link of the report in email(without attaching the report);to what that link points to and cant we use that with ReportViewer control to show report to user.
2. I think after the schedule runs and finish processing report report service would be updating some table to show that this schedule is completed or not.
3. Just got an idea that, can i save the report in an ftp location through schedule and pick the report from there to show to user?
hope that makes sense....
|||
1. The parameters needs to be set when creating the subscription not schedule. A schedule can be shared among subscriptions. As I mentioned, if you decide to use subcribed delivery, it will be the end user who will set the parameters. When the user clicks on the link, the report will be open in the ASP.NET ReportViewer control. In the case of a custom application, we address a similar requirement by having a custom job controller which would generate the report on the server as a snapshot and send the history ID to the application once the report is ready.
2. Again, there is a difference between a schedule and subscription (if this is what you would use). That said, you can use GetScheduleProperties API to get the last time the schedule is run.
3. A subscribed report can be delivered to a network share. Start creating a subscription and you will see that you have a choice between e-mail and network share delivery.
|||
Teo Lachev wrote: |
|
When the user clicks on the link, the report will be open in the ASP.NET ReportViewer control. |
Did'nt got which link you are talking about...one sent in email? how come it will be opened in reportviewer?
Teo Lachev wrote: |
|
In the case of a custom application, we address a similar requirement by having a custom job controller which would generate the report on the server as a snapshot and send the history ID to the application once the report is ready. |
I think thats what I am looking for, can you provide some links for this or some sample app.
And by using CreateSubscription API i can set the schedule also or will need something else for that?
|||
Did'nt got which link you are talking about...one sent in email? how come it will be opened in reportviewer?
When you set up an e-mail subscription you can configure it to send the report link instead of the entire report. The report will open up in the ASP.NET report viewer. Try it out http://localhost/reportserver?/AdventureWorks%20Sample%20Reports/Company%20Sales&rs:Command=Render
I think thats what I am looking for, can you provide some links for this or some sample app.
In our case, we don't use subscriptions. Instead, the job service generates the report as a snapshot
if (parameters != null) // set report parameters {
managementProxy.SetReportParameters(reportPath, parameters);
}
// Create the report snapshot so the user can browse the report
managementProxy.UpdateReportExecutionSnapshot(reportPath);
// Check if the report is configured to keep snapshots in history
bool keepExecutionShapshots = false;
bool result = managementProxy.GetReportHistoryOptions(reportPath, out keepExecutionShapshots, out schedule);
if (keepExecutionShapshots)
{
// history is automatically created, get the list of history runs
ReportHistorySnapshot[] history = managementProxy.ListReportHistory(reportPath);
Array.Sort(history, CompareReportHistoryByDate); // need to sorty by date since history runs may not be chronologically sorted
historyID = history[history.Length - 1].HistoryID; //grab the last history run
}
else
{
// explicitly create history snapshot
historyID = managementProxy.CreateReportHistorySnapshot(reportPath, out warnings);
}