5
votes

I hope someone can help me with this. It's killing me. I've spent hours over days on it and my client is becoming increasingly frustrated. :(

I am hosting on Azure Websites and SQL Azure. I am using v.10 of the Reporting assemblies. Everything works perfectly fine outside of Azure (localhost, no problems)

I have a ReportViewer in ASP.NET within a user control. The ReportViewer and RDLC are working perfectly for display and export to Excel/Word, however I am having issues with PDF export and printing within IE.

When printing:

Prompt: An error occurred during printing. (0x80004005)

and

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3) Timestamp: Wed, 24 Apr 2013 03:18:56 UTC

Message: Unspecified error. Line: 1058 Char: 13 Code: 0 URI: http://XXXXXXX.azurewebsites.net/Reserved.ReportViewerWebControl.axd?OpType=Resource&Version=10.0.40219.329&Name=ViewerScript

Line 1058 of that .axd is:

printObj.Print(printInfo.PrintRequestPath, printInfo.PrintRequestQuery, printInfo.ReportDisplayName);

When exporting to PDF:

Server Error in '/' Application.

Parameter is not valid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Parameter is not valid.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Parameter is not valid.]
System.Drawing.Graphics.GetHdc() +1143305
Microsoft.ReportingServices.Rendering.RichText.LineBreaker.Flow(TextBox textBox, Graphics g, FontCache fontCache, FlowContext flowContext, Boolean keepLines, Single& height) +57
Microsoft.ReportingServices.Rendering.RichText.TextBox.MeasureFullHeight(TextBox textBox, Graphics g, FontCache fontCache, FlowContext flowContext, Single& contentHeight) +500
Microsoft.ReportingServices.Rendering.HPBProcessing.TextBox.DetermineVerticalSize(PageContext pageContext, Double topInParentSystem, Double bottomInParentSystem, List1 ancestors, Boolean& anyAncestorHasKT, Boolean hasUnpinnedAncestors) +381
Microsoft.ReportingServices.Rendering.HPBProcessing.PageItem.CalculateVertical(PageContext pageContext, Double topInParentSystem, Double bottomInParentSystem, PageItem[] siblings, List
1 ancestors, Boolean& anyAncestorHasKT, Boolean hasUnpinnedAncestors, Nullable1 sourceWidth) +695
Microsoft.ReportingServices.Rendering.HPBProcessing.RowInfo.CalculateVerticalLastDetailCell(PageContext context, Boolean firstTouch, Boolean delayCalc) +411
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.CreateDetailCell(Tablix tablix, TablixMember colMemberParent, Int32 colGridIndex, RowInfo rowInfo, PageContext pageContext) +822
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.TraverseColumnMembers(Tablix tablix, TablixMember colMemberParent, Int32 parentColIndex, RowInfo currRowInfo, Boolean create, Double startInTablix, Double endInTablix, Int32& detailCellIndex, Int32& visibleSpan, List
1 detailCellsState, PageContext pageContext) +108
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.TraverseColumnMembers(Tablix tablix, TablixMember colMemberParent, Int32 parentColIndex, RowInfo currRowInfo, Boolean create, Double startInTablix, Double endInTablix, Int32& detailCellIndex, Int32& visibleSpan, List1 detailCellsState, PageContext pageContext) +869
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.CreateDetailRow(Tablix tablix, TablixMember rowMemberParent, Int32 parentRowIndex, Int32 parentColIndex, PageContext pageContext) +292
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.CreateRowMemberChildren(Tablix tablix, TablixMember rowMemberParent, Int32 defTreeLevel, Boolean parentBorderHeader, Int32 parentRowIndex, Int32 parentColIndex, Int32 sourceIndex, Boolean resetContext, Boolean parentHasFooters, LevelInfo parentLevelInfo, PageContext pageContext) +137
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.CreateRowMemberChildren(Tablix tablix, TablixMember rowMemberParent, Int32 defTreeLevel, Boolean parentBorderHeader, Int32 parentRowIndex, Int32 parentColIndex, Int32 sourceIndex, Boolean resetContext, Boolean parentHasFooters, LevelInfo parentLevelInfo, PageContext pageContext) +2822
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.CreateRowMemberChildren(Tablix tablix, TablixMember rowMemberParent, Int32 defTreeLevel, Boolean parentBorderHeader, Int32 parentRowIndex, Int32 parentColIndex, Int32 sourceIndex, Boolean resetContext, Boolean parentHasFooters, LevelInfo parentLevelInfo, PageContext pageContext) +2822
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.CreateRowMemberChildren(Tablix tablix, TablixMember rowMemberParent, Int32 defTreeLevel, Boolean parentBorderHeader, Int32 parentRowIndex, Int32 parentColIndex, Int32 sourceIndex, Boolean resetContext, Boolean parentHasFooters, LevelInfo parentLevelInfo, PageContext pageContext) +2822
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.CreateTablixRows(Tablix tablix, TablixMember rowMemberParent, Int32 defTreeLevel, Boolean parentBorderHeader, Int32 parentRowIndex, Int32 parentColIndex, List
1& pageStructMemberCell, Boolean ignoreTotals, Boolean& finishLevel, Boolean parentHasFooters, CreateItemsContext createItems, Double startInTablix, Double endInTablix, PageContext pageContext) +2310 Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.CreateTablixItems(Tablix tablix, PageContext pageContext, CreateItemsContext createItems, Double startInTablix, Double endInTablix) +113
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.CreateVertically(PageContext pageContext, CreateItemsContext createItems, Double startInTablix, Double endInTablix, Double topInParentSystem) +286
Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.DetermineVerticalSize(PageContext pageContext, Double topInParentSystem, Double bottomInParentSystem, List1 ancestors, Boolean& anyAncestorHasKT, Boolean hasUnpinnedAncestors) +646
Microsoft.ReportingServices.Rendering.HPBProcessing.PageItem.CalculateVertical(PageContext pageContext, Double topInParentSystem, Double bottomInParentSystem, PageItem[] siblings, List
1 ancestors, Boolean& anyAncestorHasKT, Boolean hasUnpinnedAncestors, Nullable1 sourceWidth) +695
Microsoft.ReportingServices.Rendering.HPBProcessing.PageItemContainer.DetermineContentVerticalSize(PageContext pageContext, Double topInParentSystem, Double bottomInParentSystem, List
1 ancestors, Boolean& anyAncestorHasKT, Boolean hasUnpinnedAncestors, Boolean resolveState, Boolean resolveItem) +273 Microsoft.ReportingServices.Rendering.HPBProcessing.PageItemContainer.DetermineVerticalSize(PageContext pageContext, Double topInParentSystem, Double bottomInParentSystem, List1 ancestors, Boolean& anyAncestorHasKT, Boolean hasUnpinnedAncestors) +145
Microsoft.ReportingServices.Rendering.HPBProcessing.PageItem.CalculateVertical(PageContext pageContext, Double topInParentSystem, Double bottomInParentSystem, PageItem[] siblings, List
1 ancestors, Boolean& anyAncestorHasKT, Boolean hasUnpinnedAncestors, Nullable1 sourceWidth) +695
Microsoft.ReportingServices.Rendering.HPBProcessing.PageItem.CalculateVertical(PageContext pageContext, Double topInParentSystem, Double bottomInParentSystem, PageItem[] siblings, List
1 ancestors, Boolean& anyAncestorHasKT, Boolean hasUnpinnedAncestors) +53
Microsoft.ReportingServices.Rendering.HPBProcessing.Report.NextPage(RPLWriter rplWriter, Int32 page, Int32 totalPages) +659
Microsoft.ReportingServices.Rendering.HPBProcessing.HPBProcessing.NextPage() +52 Microsoft.ReportingServices.Rendering.HPBProcessing.HPBProcessing.Init(Report report, PaginationSettings pagination, CreateAndRegisterStream createAndRegisterStream, Hashtable& renderProperties) +348
Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer.Render(Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream) +141
Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream) +61

[LocalProcessingException: An error occurred during local report processing.]
Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings) +333
Microsoft.Reporting.WebForms.LocalModeSession.RenderReport(String format, Boolean allowInternalRenderers, String deviceInfo, NameValueCollection additionalParams, Boolean cacheSecondaryStreamsForHtml, String& mimeType, String& fileNameExtension) +215
Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +154
Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +216
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929

Thank you.

3
I think you should focus on the [LocalProcessingException: An error occurred during local report processing.] portion. I've not used this mode myself but it almost sounds like you're including your report file in your ASP.NET solution but it's not being deployed to the server. Is this the case? And if so, what's the copy/build settings for this file in Solution Explorer/Properties?Jaxidian
Thanks for the reply! It's possible I'm missing a .dll but can't imagine what it might be. I'm including all the reporting assemblies. Also, the reports display and export to Word/Excel without a problem. They just don't work with the IE-only print option, nor will they export to PDF from the ReportViewer. EDIT: I should add that the .rdlc files are being deployed and have verified that via FTP.trnelson

3 Answers

3
votes

PDF generation is actually not supported in the security configuration on WAWS, in this case you should use either a WebRole or a Web Server on a Virtual Machine. Thanks! Nir (WAWS team)

4
votes

I got same issue today when I was publishing to Azure Web Site(App). Problem was solved by migrating site from FREE to BASIC app service plan tier.

0
votes

one more possibility could be the missing dlls on the cloud. For reporting, as you have referenced the Microsoft.Reporting.Webforms dll which gets locally stored on your local drive and doesn't gets packaged when you deploy your application on the cloud. So, we are suppose to also copy/upload/deploy these dlls too on cloud.