Showing posts with label subreports. Show all posts
Showing posts with label subreports. Show all posts

Thursday, March 29, 2012

Error exporting report to PDF

I have a report with embedded subreports for different departments. When I render a department with short subreports the report exports to PDF fine, but when I have a department with longer subreports then I get an error when exporting. Here is the tail end of the error message in the log file:

inetinfo!library!334!03/01/2006-16:08:30:: i INFO: Call to RenderNext( '/Budgeting/Department_Spending_Report' )
inetinfo!chunks!334!03/01/2006-16:08:30:: i INFO: ### GetReportChunk('RenderingInfo_PDF', 2), chunk was not found! this=a34ae82e-c4b2-4343-be6b-3989db988405
inetinfo!reportrendering!334!03/01/2006-16:08:32:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown., ;
Info: Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. > Microsoft.ReportingServices.ReportRendering.ReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. > System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemCollection.get_Item(Int32 index)
at Microsoft.ReportingServices.Rendering.ImageRenderer.Table.CalculateItemMeasurement(Orientation orientation, Double childrenMaximumDistance, ReAdjustments itemReAdjustment, ItemContext savedContext)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.ProcessPages(CompositionBase theComposition, Report theReport, Boolean needTotalPages, Int32 startPage, Int32 endPage, Boolean render)
at Microsoft.ReportingServices.Rendering.ImageRenderer.PdfReport.RenderReport(Report report, NameValueCollection deviceInfo, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStreamCallback)
at Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStream)
End of inner exception stack trace
at Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStream)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderSnapshot(CreateReportChunk createChunkCallback, RenderingContext rc, GetResource getResourceCallback)
End of inner exception stack trace
inetinfo!webserver!334!03/01/2006-16:08:32:: e ERROR: Reporting Services error Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. > Microsoft.ReportingServices.ReportRendering.ReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. > System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

I'm running Reporting Services SP2. I've searched other postings and I can't seem to find anyone else with the same issue. I'm able to export to excel with no problem.

Any help would be appreciated.

Thank You.

I'm sorry I don't have a solution for you. But I'm having the same problem producing a pdf. I have a report that has a subreport that has a subreport (three levels of reporting). I have verified that when no third level subreport is larger than one page, the pdf is created successfully. However, when any third level subreport extends beyond one page, a pdf cannot successfully be generated. The hourglass never goes away when trying to generate the pdf.

I'm hoping that someone who reads this may have a solution for both of us.

I have been working on this problem for several days, and I'm desparate.

Bob

Error exporting report to PDF

I have a report with embedded subreports for different departments. When I render a department with short subreports the report exports to PDF fine, but when I have a department with longer subreports then I get an error when exporting. Here is the tail end of the error message in the log file:

inetinfo!library!334!03/01/2006-16:08:30:: i INFO: Call to RenderNext( '/Budgeting/Department_Spending_Report' )
inetinfo!chunks!334!03/01/2006-16:08:30:: i INFO: ### GetReportChunk('RenderingInfo_PDF', 2), chunk was not found! this=a34ae82e-c4b2-4343-be6b-3989db988405
inetinfo!reportrendering!334!03/01/2006-16:08:32:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown., ;
Info: Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. > Microsoft.ReportingServices.ReportRendering.ReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. > System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemCollection.get_Item(Int32 index)
at Microsoft.ReportingServices.Rendering.ImageRenderer.Table.CalculateItemMeasurement(Orientation orientation, Double childrenMaximumDistance, ReAdjustments itemReAdjustment, ItemContext savedContext)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance)
at Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.ProcessPages(CompositionBase theComposition, Report theReport, Boolean needTotalPages, Int32 startPage, Int32 endPage, Boolean render)
at Microsoft.ReportingServices.Rendering.ImageRenderer.PdfReport.RenderReport(Report report, NameValueCollection deviceInfo, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStreamCallback)
at Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStream)
End of inner exception stack trace
at Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStream)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderSnapshot(CreateReportChunk createChunkCallback, RenderingContext rc, GetResource getResourceCallback)
End of inner exception stack trace
inetinfo!webserver!334!03/01/2006-16:08:32:: e ERROR: Reporting Services error Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. > Microsoft.ReportingServices.ReportRendering.ReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. > System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

I'm running Reporting Services SP2. I've searched other postings and I can't seem to find anyone else with the same issue. I'm able to export to excel with no problem.

Any help would be appreciated.

Thank You.

I'm sorry I don't have a solution for you. But I'm having the same problem producing a pdf. I have a report that has a subreport that has a subreport (three levels of reporting). I have verified that when no third level subreport is larger than one page, the pdf is created successfully. However, when any third level subreport extends beyond one page, a pdf cannot successfully be generated. The hourglass never goes away when trying to generate the pdf.

I'm hoping that someone who reads this may have a solution for both of us.

I have been working on this problem for several days, and I'm desparate.

Bob

Error exporting a subreport to Excel!?

Hi All,

I have a report sonsisting of two subreports. When I export it to Excel I get an Error!! I played around with it and I found out that if I use ReportItems in my page header it will cause this error! Does anyone have any idea why? Is this a bug or there is some work around it! Thanks.We have talked to our Microsoft rep and they have told us that it is a "feature" and that is how is was designed. It is true that a subreport within a table or matrix will not export to excel. The only workaround is to have the subreport outside of the table or matrix, have the report export to pdf instead, or export the first page of the report (if there are no subreports on the first page) and run the report through excel.

Our rep is seeing if she can get the development team to change it, but I think our chances are slim.|||Thanks for the reply. My case is different! I don't have a table or matrix with subreport in it! I just have a plain page with subreports. Exporting to Excel works only if there is NO reference to any item on the report from Page Header! When I have a "ReportItems!MyText.Value" any where in the Page Header, then exporting to Excel fails!|||

What version of RS are you using? Could you send us the report files, please?

Thank you,

Nico

|||

I'm using RS 2000

Try this Main Report. You need "Company Sales" sample report as your sub-report.

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<PageHeader>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>textbox1</rd:DefaultName>
<Width>2in</Width>
<Top>0.125in</Top>
<CanGrow>true</CanGrow>
<Value>=ReportItems!MyTextBox.Value</Value>
<Left>4.125in</Left>
</Textbox>
</ReportItems>
<PrintOnLastPage>true</PrintOnLastPage>
<PrintOnFirstPage>true</PrintOnFirstPage>
<Style />
<Height>0.375in</Height>
</PageHeader>
<RightMargin>0.5in</RightMargin>
<Body>
<ReportItems>
<Textbox Name="MyTextBox">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<Height>0.25in</Height>
<Width>2.625in</Width>
<Top>5.125in</Top>
<CanGrow>true</CanGrow>
<Value>=Fields!Name.Value</Value>
<Left>2in</Left>
</Textbox>
<Subreport Name="subreport1">
<Style />
<ReportName>Company Sales</ReportName>
<Height>4.5in</Height>
<Width>5.875in</Width>
<Top>0.125in</Top>
<Left>0.25in</Left>
</Subreport>
</ReportItems>
<Style />
<Height>6in</Height>
</Body>
<TopMargin>0.5in</TopMargin>
<DataSources>
<DataSource Name="AdventureWorks2000">
<rd:DataSourceID>75e82b3d-05fd-468b-920e-b793f54e666c</rd:DataSourceID>
<DataSourceReference>AdventureWorks2000</DataSourceReference>
</DataSource>
</DataSources>
<Code />
<Width>6.5in</Width>
<DataSets>
<DataSet Name="DataSet1">
<Fields>
<Field Name="ProductCategoryID">
<DataField>ProductCategoryID</DataField>
<rd:TypeName>System.Byte</rd:TypeName>
</Field>
<Field Name="Name">
<DataField>Name</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>AdventureWorks2000</DataSourceName>
<CommandText>SELECT DISTINCT ProductCategoryID, Name
FROM ProductCategory
ORDER BY Name</CommandText>
</Query>
</DataSet>
</DataSets>
<LeftMargin>0.5in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>55a44d5c-37c0-4b84-b326-e2e6aa50fb35</rd:ReportID>
<BottomMargin>0.5in</BottomMargin>
<Language>en-US</Language>
</Report>

|||

Hi,

Did anybody from Microsoft found out about this bug? I'm still waiting for a solution! Please help! Thanks.

|||

hi,

this has been cracked already....

hehe

microsoft did not bother to provide anything on this.

but we discovered a work around.

and it works awesome ...i guess this is what we do at www.snktheone. to provide solution to all the challenges faced in Reporting services development and Web development.

use the list control and then drop all the table in your subreport into this list control.

make sure List control uses the same dataregion as your subreports.

this made wonders for us..

hope i would have solved your query..

Regards,

www.snktheone.com

|||Didn't work!! I put my sub-report inside a List control and now my report is repeated multiple times! How do you make it to repeat it only once? I still get an error when exporting to Excel! Any other solutions? Thanks.|||

hi mike,

i came across a situation in which i had a table and then i needed 3 subreports to be embedded inside the table. i used the subreports as not the control subreport, butinstead i used the table which i created for these sub reports and then dropped these tables in a single list control

also i made sure that all the 3 tables called the same stored procedure, which was called from the list control.

i hope it does make a diff for u.

regards

www.snktheone.com

|||In my situation there is no table! Just a simple sub-report. Anyhow, I ended up removing the header and any reference to the ReportItems from my report Footer to make it work! I believe this is the only solution to this MS bug! But, still love to see if someone come up with a solution for this glitch. Thanks.

Error exporting a subreport to Excel!?

Hi All,

I have a report sonsisting of two subreports. When I export it to Excel I get an Error!! I played around with it and I found out that if I use ReportItems in my page header it will cause this error! Does anyone have any idea why? Is this a bug or there is some work around it! Thanks.We have talked to our Microsoft rep and they have told us that it is a "feature" and that is how is was designed. It is true that a subreport within a table or matrix will not export to excel. The only workaround is to have the subreport outside of the table or matrix, have the report export to pdf instead, or export the first page of the report (if there are no subreports on the first page) and run the report through excel.

Our rep is seeing if she can get the development team to change it, but I think our chances are slim.|||Thanks for the reply. My case is different! I don't have a table or matrix with subreport in it! I just have a plain page with subreports. Exporting to Excel works only if there is NO reference to any item on the report from Page Header! When I have a "ReportItems!MyText.Value" any where in the Page Header, then exporting to Excel fails!|||

What version of RS are you using? Could you send us the report files, please?

Thank you,

Nico

|||

I'm using RS 2000

Try this Main Report. You need "Company Sales" sample report as your sub-report.

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<PageHeader>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>textbox1</rd:DefaultName>
<Width>2in</Width>
<Top>0.125in</Top>
<CanGrow>true</CanGrow>
<Value>=ReportItems!MyTextBox.Value</Value>
<Left>4.125in</Left>
</Textbox>
</ReportItems>
<PrintOnLastPage>true</PrintOnLastPage>
<PrintOnFirstPage>true</PrintOnFirstPage>
<Style />
<Height>0.375in</Height>
</PageHeader>
<RightMargin>0.5in</RightMargin>
<Body>
<ReportItems>
<Textbox Name="MyTextBox">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<Height>0.25in</Height>
<Width>2.625in</Width>
<Top>5.125in</Top>
<CanGrow>true</CanGrow>
<Value>=Fields!Name.Value</Value>
<Left>2in</Left>
</Textbox>
<Subreport Name="subreport1">
<Style />
<ReportName>Company Sales</ReportName>
<Height>4.5in</Height>
<Width>5.875in</Width>
<Top>0.125in</Top>
<Left>0.25in</Left>
</Subreport>
</ReportItems>
<Style />
<Height>6in</Height>
</Body>
<TopMargin>0.5in</TopMargin>
<DataSources>
<DataSource Name="AdventureWorks2000">
<rd:DataSourceID>75e82b3d-05fd-468b-920e-b793f54e666c</rd:DataSourceID>
<DataSourceReference>AdventureWorks2000</DataSourceReference>
</DataSource>
</DataSources>
<Code />
<Width>6.5in</Width>
<DataSets>
<DataSet Name="DataSet1">
<Fields>
<Field Name="ProductCategoryID">
<DataField>ProductCategoryID</DataField>
<rd:TypeName>System.Byte</rd:TypeName>
</Field>
<Field Name="Name">
<DataField>Name</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>AdventureWorks2000</DataSourceName>
<CommandText>SELECT DISTINCT ProductCategoryID, Name
FROM ProductCategory
ORDER BY Name</CommandText>
</Query>
</DataSet>
</DataSets>
<LeftMargin>0.5in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>55a44d5c-37c0-4b84-b326-e2e6aa50fb35</rd:ReportID>
<BottomMargin>0.5in</BottomMargin>
<Language>en-US</Language>
</Report>

|||

Hi,

Did anybody from Microsoft found out about this bug? I'm still waiting for a solution! Please help! Thanks.

|||

hi,

this has been cracked already....

hehe

microsoft did not bother to provide anything on this.

but we discovered a work around.

and it works awesome ...i guess this is what we do at www.snktheone. to provide solution to all the challenges faced in Reporting services development and Web development.

use the list control and then drop all the table in your subreport into this list control.

make sure List control uses the same dataregion as your subreports.

this made wonders for us..

hope i would have solved your query..

Regards,

www.snktheone.com

|||Didn't work!! I put my sub-report inside a List control and now my report is repeated multiple times! How do you make it to repeat it only once? I still get an error when exporting to Excel! Any other solutions? Thanks.|||

hi mike,

i came across a situation in which i had a table and then i needed 3 subreports to be embedded inside the table. i used the subreports as not the control subreport, butinstead i used the table which i created for these sub reports and then dropped these tables in a single list control

also i made sure that all the 3 tables called the same stored procedure, which was called from the list control.

i hope it does make a diff for u.

regards

www.snktheone.com

|||In my situation there is no table! Just a simple sub-report. Anyhow, I ended up removing the header and any reference to the ReportItems from my report Footer to make it work! I believe this is the only solution to this MS bug! But, still love to see if someone come up with a solution for this glitch. Thanks.