Friday, February 10, 2012

Calling the same report in a batch (rs2005) from aspx page

Hi,
what would be the best way to call the same report with diffrent
parameters.
right now I am calling the RenderInvoice which is called in a loop
(view code below)
is there a better way to do this, like a batch process?
this works, and it does 50 reports in about one minute, I wonder if I
can make it go faster.
or it's just an issue of computer hardware.
Thanks.
protected Byte[] RenderInvoice(ReportExecutionService rs,string
shipmentId)
{
ParameterValue[] parameters = new ParameterValue[2];
parameters[0] = new ReportExecutionWS.ParameterValue();
parameters[0].Name = "ShipmentId";
parameters[0].Value = shipmentId;
parameters[1] = new ReportExecutionWS.ParameterValue();
parameters[1].Name = "ShowLogo";
parameters[1].Value = "True";
// set report parameters
rs.SetExecutionParameters(parameters, "en-us");
// set rendering info
Byte[] result = null;
String format = "PDF";
String devInfo = "<DeviceInfo><Toolbar>False</Toolbar></
DeviceInfo>";
String extension = "";
String encoding = "";
String mimeType = "";
Warning[] warnings = null;
string[] streamIDs = null;
result = rs.Render(format, devInfo, out extension, out
encoding, out mimeType, out warnings, out streamIDs);
return result;
}You are running the reports one after another. A minute for 50 reports
sounds pretty good to me. RS could do these in parallel but your app would
need to do request the rendering asynchronously. My suggestion is to leave
it alone. I don't think a whole lot of complexity to speed it up more is
worth the effort.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<rperetz@.gmail.com> wrote in message
news:1182807919.166551.199320@.g4g2000hsf.googlegroups.com...
> Hi,
> what would be the best way to call the same report with diffrent
> parameters.
> right now I am calling the RenderInvoice which is called in a loop
> (view code below)
> is there a better way to do this, like a batch process?
> this works, and it does 50 reports in about one minute, I wonder if I
> can make it go faster.
> or it's just an issue of computer hardware.
> Thanks.
>
> protected Byte[] RenderInvoice(ReportExecutionService rs,string
> shipmentId)
> {
> ParameterValue[] parameters = new ParameterValue[2];
> parameters[0] = new ReportExecutionWS.ParameterValue();
> parameters[0].Name = "ShipmentId";
> parameters[0].Value = shipmentId;
> parameters[1] = new ReportExecutionWS.ParameterValue();
> parameters[1].Name = "ShowLogo";
> parameters[1].Value = "True";
> // set report parameters
> rs.SetExecutionParameters(parameters, "en-us");
> // set rendering info
> Byte[] result = null;
> String format = "PDF";
> String devInfo = "<DeviceInfo><Toolbar>False</Toolbar></
> DeviceInfo>";
> String extension = "";
> String encoding = "";
> String mimeType = "";
> Warning[] warnings = null;
> string[] streamIDs = null;
>
> result = rs.Render(format, devInfo, out extension, out
> encoding, out mimeType, out warnings, out streamIDs);
> return result;
> }
>

No comments:

Post a Comment