We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error with Reporting Services Render with DOCX (stress test)

Hi,


While batching multiple requests to SSRS I appear to get errors at random times. Currently I have for example 1000 reports waiting on a queue and 10 run in parallel (same rdl is being called).

I am calling SSRS in code.

 execInfo = ssrs.LoadReport(reportPath, null);
ssrs.SetExecutionParameters(paramValues.ToArray(), null);
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
string[] streamIDs = null;
data = ssrs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
execInfo = ssrs.GetExecutionInfo();

When exporting to Microsoft DOC format I do not get any errors however when rendering to DOCX (ASPOSE) I see the following error (around 11 of the 10000 renders).
when I run the 11 individually they pass.

rrRenderingError400An error occurred during rendering of the report.http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rrRenderingError&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=10.50.1790.0Microsoft SQL Server Reporting Services10.50.1790.01033OsIndependent1033Microsoft.ReportingServices.ProcessingCoreAn error occurred during rendering of the report.mscorlibCollection was modified; enumeration operation may not execute.

Any idea’s what I can do to diagnose the issue ?

edit:

I have attached some more error info form the SSRS logs

Hi Neil,


Thanks for your inquiry. It would be great, If you please use select statement (to populate the data ) inside your RDL file and share it with us. I will investigate the issue on my side and provide you more information.

Please see the following DataSet example with select statement for your kind reference:

<DataSets><o:p></o:p>

<DataSet Name=DataSet1><o:p></o:p>

<Query><o:p></o:p>

<DataSourceName>DataSource1</DataSourceName><o:p></o:p>

<CommandText>select 1 as value, ‘label1’ as label<o:p></o:p>

union all<o:p></o:p>

select 2 as value, ‘label2’ as label<o:p></o:p>

union all<o:p></o:p>

select 3 as value, ‘label3’ as label<o:p></o:p>

union all<o:p></o:p>

select 4 as value, ‘label4’ as label<o:p></o:p>

</CommandText><o:p></o:p>

</Query><o:p></o:p>

<Fields><o:p></o:p>

<Field Name=value><o:p></o:p>

<DataField>value</DataField><o:p></o:p>

<rd:TypeName>System.Int32</rd:TypeName><o:p></o:p>

</Field><o:p></o:p>

<Field Name=label><o:p></o:p>

<DataField>label</DataField><o:p></o:p>

<rd:TypeName>System.String</rd:TypeName><o:p></o:p>

</Field><o:p></o:p>

</Fields><o:p></o:p>

</DataSet><o:p></o:p>

</DataSets>


Hi Tahir,


that dataset does not fit into the rdl nicely so I have just added random data that matches the currently structure. Is that OK ?

Please note I am using the version of aspose provided from this thread:

Export to docx adding page breaks for table groups
Export to docx adding page breaks for table groups

provided by Vadim (buddylancer).

Please can you keep me updated…

Edit: I think the problem could be due to the groupings. I removed all detail/group rows except for the TOTAL row and did not see the issue occur. Maybe that’s a starting point.

Hi Neil,


Thanks for sharing the files. I will investigate this issue on my side and update you asap.

Hi Neil,


Thanks for your patience. I have exported the shared RDL file to Doc/Docx file format and have not faced any exception. It would be great if you please create a sample application with shared RDL file and share that application here for investigation purposes. I appreciate your cooperation in advance for this.

Hi Tahir,


Please can you share how you attempted to reproduce the issue.
Did you attempt to call the report server multiple times in parallel ?

It would help if I knew the approach you took.

Hi Neil,


Please accept my apologies for late response.

Thanks for your inquiry. I investigated your RDL with export option, one file at a time and did not found any issue. I know, the issue you are facing is with exporting RDL file in parallel (10 run in parallel (same rdl is being called). Also, after removing detail/group removes this exception.

To investigate/reproduce this issue, we need to use the same approach which you are following in your code. So, It would be great if you please create a test application with same RDL file and share it here for testing purposes. We really keen to help you but need some more details from your side.

Hi Tahir,


I will look to make an example app for you. I do not understand why you do not have existing infrastructure to run reports in parallel. I would have expected this to be available to you.


Hi Tahir,


attached is a sample console application that will run in parallel 1000 calls to SSRS. (Not sure how many threads are running in parallel however the error still occurs).

To run it:

ConcurrencyIssue.exe “http://{SERVER}:{PORT}/{SSRS Instance}/ReportExecution2005.asmx” "{SSRS PATH TO REPORT}/TestReport"

The first parameter is the URL to the ReportExecution2005 service and the second is the path to the report in SSRS. This will all depend on your setup.

I have attached TestReport.RDL to test with.

The code is attached and the .exe is in the debug directory. The documents are written to the debug\output directory and the error.txt file is created in the debug directory. It will show you the error.

I ran it twice on my side - the first time i saw the error was after 800 calls and the second time was after around 300 calls.

Let me know if there are any problems running it.

Hi Neil,


Thanks for sharing the details. I am working over your query and will get back to you soon.

Hi Neil,


Thanks for your patience. I have tested the scenario for parallel 1000 calls with same DLL shared by Vadim at this link. Please see the attachment. It would be great if you please test the same TestReport.rdl file at your end and share your findings with us. Please restart SQL Server Reporting Services before testing. I have attached an output document with this post.


Hi Tahir,


I have tried it on a second instance (on a different machine). I restarted it etc. What was interesting was that i ran the example application a couple of times and it was successful. After running it around the 4th/5th time I started to see the error.

Please can you try it a few times… OR if you want change the number of calls being made … maybe from 1000 to 3000. But I think you need to run it a few times based on what I have just seen.

Hi,


Is there an update on this ?

Hi Neil,

Could you please check caching options on the side of Reporting Server?
It is in Properties -> Execution tab in SSRS configuration pages.

Regards,
Vadim

Hi Vadim,


Please have a look at the attached screenshot. Are you referring to report level caching ? It looks like caching is off.

Hi Neil,



Right, this is report level caching.

Is it possible to switch on caching (say for 1 min)?
And then re-run the set of reports?

Regards,
Vadim

Hi Vadim,


Thanks,

I have tested the example app with caching on and have run it multiple times and have not seen the issue. I need to test it on the actual application, however SSRS caching will kick in for specific repeated parameters, and in the original identification of the problem the report was being called in parallel with differing parameter values for each call and therefore not sure if this would be a viable work around in this instance.

I will do a test though and will let you know. I would just like to confirm though - have you been able to reproduce the issue on your side ?

Hi Neil,

>have you been able to reproduce the issue on your side ?

I will try to reproduce today and will let you know.

Regards,
Vadim

Hi,


Enabling caching does not seem to have fixed the issue when parameters are changed for the different parallel calls.

Any luck reproducing the issue ?

Hi Neil,


Please accept my apologies for late response.
neilst:

I have tried it on a second instance (on a different machine). I restarted it etc. What was interesting was that i ran the example application a couple of times and it was successful. After running it around the 4th/5th time I started to see the error.

Please can you try it a few times… OR if you want change the number of calls being made … maybe from 1000 to 3000. But I think you need to run it a few times based on what I have just seen.
I have tested the same scenario for five times with parallel 1000 calls to SSRS and have not faced any issue. I am using the same TestReport.rdl report shared at this forum link. Are you using the same RDL file?