all groups > sql server reporting services > march 2006 >
You're in the

sql server reporting services

group:

HELP: Generating Multiple Reports at the Same Time


Re: HELP: Generating Multiple Reports at the Same Time sullins602
3/14/2006 12:52:44 PM
sql server reporting services:
by generate do you just mean open in a browser window? I have done
stuff in the past where I have a stored procedure that exports HTML to
a file and labels it as .xls which seems to render fine in MS Excel >
2000. If this is a viable option you could just assign a stored
procedure name to each report selected and when they are ran it would
just create the excel files on a share somewhere...thats how I would
most likely do it...

Hope this helps!
--
Ben Sullins
http://bensullins.com
HELP: Generating Multiple Reports at the Same Time kewl
3/14/2006 1:45:44 PM
Hello,
We have created an ASP.NET 2.0 (C#) intranet application that uses SQL =
Server 2005 Reporting Services and that needs to generate multiple =
reports at the same time. Let me try to explain.

In our application we allow users to select a number of reports and save =
them as a report group. Each individual report's details (report name, =
report path, parameters, parameter values, etc.) are saved into our own =
SQL Server 2005 database tables. Then in the code for our application =
we have a method that iterates through all the records in our =
ReportGroups table (this table says which reports are in which group) =
and tries to generate each one programmatically.

So, our first thought was to spawn a new browser window for each report =
and use URL access to generate each of the reports in the report group =
(each report would be in it's own window). Here's some example code:


// Go thru each datarow in the datatable
foreach (System.Data.DataRow drReportGroupsDetails in =
tableReportGroupsDetails.Rows)
{
// Get the needed values from the datatable
string reportName =3D (string)drReportGroupsDetails["ReportName"];
string reportPath =3D (string)drReportGroupsDetails["ReportPath"];

// Do other work ...

// Build the URL - NOTE: The reportName and reportPath variables are =
different each time thru the loop
// Build the URL for URL access to the report and ReportServer
url =3D "http://localhost/..." + reportPath + "..." + all other =
parameters/values + "...";

// Build the javascript to display the message
sScript =3D "<script language=3D\"javascript\" =
type=3D\"text/javascript\">window.open(\"" + url + "\", =
\"GenerateReport\", =
\"height=3D675,width=3D975,left=3D0,top=3D0,copyHistory=3Dno,directories=3D=
no,location=3Dno,menubar=3Dno,resizable=3Dno,scrollbars=3Dno,status=3Dno,=
toolbar=3Dno\");</script>";

// Execute the script
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), =
"GenerateReport", sScript);
}


This, for the most part, works. We're having troubles spawning multiple =
browser windows.

But, my real question(s) is: Would anyone know of a better way to =
provide such functionality? Does anyone have any other great ideas on =
how to generate multiple reports programmatically?


Re: Generating Multiple Reports at the Same Time Chris Taylor
3/14/2006 3:15:44 PM
Try using an IFrame instead that hosts the page... That should avoid =
popup blocking and allowing you to still generate multiple reports. =20


[quoted text, click to view]
Hello,
We have created an ASP.NET 2.0 (C#) intranet application that uses SQL =
Server 2005 Reporting Services and that needs to generate multiple =
reports at the same time. Let me try to explain.

In our application we allow users to select a number of reports and =
save them as a report group. Each individual report's details (report =
name, report path, parameters, parameter values, etc.) are saved into =
our own SQL Server 2005 database tables. Then in the code for our =
application we have a method that iterates through all the records in =
our ReportGroups table (this table says which reports are in which =
group) and tries to generate each one programmatically.

So, our first thought was to spawn a new browser window for each =
report and use URL access to generate each of the reports in the report =
group (each report would be in it's own window). Here's some example =
code:


// Go thru each datarow in the datatable
foreach (System.Data.DataRow drReportGroupsDetails in =
tableReportGroupsDetails.Rows)
{
// Get the needed values from the datatable
string reportName =3D (string)drReportGroupsDetails["ReportName"];
string reportPath =3D (string)drReportGroupsDetails["ReportPath"];

// Do other work ...

// Build the URL - NOTE: The reportName and reportPath variables =
are different each time thru the loop
// Build the URL for URL access to the report and ReportServer
url =3D "http://localhost/..." + reportPath + "..." + all other =
parameters/values + "...";

// Build the javascript to display the message
sScript =3D "<script language=3D\"javascript\" =
type=3D\"text/javascript\">window.open(\"" + url + "\", =
\"GenerateReport\", =
\"height=3D675,width=3D975,left=3D0,top=3D0,copyHistory=3Dno,directories=3D=
no,location=3Dno,menubar=3Dno,resizable=3Dno,scrollbars=3Dno,status=3Dno,=
toolbar=3Dno\");</script>";

// Execute the script
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), =
"GenerateReport", sScript);
}


This, for the most part, works. We're having troubles spawning =
multiple browser windows.

But, my real question(s) is: Would anyone know of a better way to =
provide such functionality? Does anyone have any other great ideas on =
how to generate multiple reports programmatically?


RE: HELP: Generating Multiple Reports at the Same Time Limey
3/14/2006 6:14:27 PM
You might want to think about creating a tabbed interface. You could
programatically generate a tab for each report. When they click on a tab you
display the corresponding report using the ASP.Net report viewer. This would
eliminate the need for popups. You could look at doing this as a postback so
you're only generating a single report at a time (caching the reports might
be a good idea), or generating them all at once and controlling the display
of each one based on javascript behind the tabs.

[quoted text, click to view]
AddThis Social Bookmark Button