问题
I am very new to SSRS and am trying to generate a report using SSRS, I am able to pull the data on to the screen without any issues but when I try to export the data to an excel file, I am getting an error "The row item structure object corresponding to a line cannot be null"
when there is data that spans multiple tabs in an excel. I am able to export to any other formats eg: PDF. After some googling I found that there is an issue with the SQL Server reporting version and Microsoft mentioned that they will release a patch to fix this issue but I dont see that there was any patch. I am using SQL Server Reporting Services Version 2007.0100.2531.00
. Any pointers will be of great help.
回答1:
Depending on the version of SSRS you're using, it might be the problem described in this post on Microsoft Connect, which should be fixed in later versions of SSRS.
Also, it can be something with page breaks, or, as in my case, matrixes without data. When I hid the matrix without data (with =CountRows("MyDataSet") = 0
), the problem was solved.
回答2:
If you have group in report then track below changes.
Right click Row group
Group Properties
Page Breaks
Remove checkbox from Also at the start of a group
Remove checkbox from Also at the end of a group
OK
回答3:
I have found the solution for the above issue, please don't provide the page break to table. Do one thing: put the table in to the rectangle and provide page break to rectangle. It worked for me.
回答4:
The bug seems to appear every time you try to render completely empty pages (height = 0) in Excel. The problem is still there in SQL Server 2008R2 Reports, the Microsoft Connect Ticket mentioned by Peter is still active.
In my case I had a report with a single Tablix and no page breaks, no space on any side, so that no additional rows or columns would be created in Excel exports. When the report returns no rows and is rendered to Excel the stated error appears, so I added a new empty row with the visibility condition "=CountRows() > 0" and it works.
回答5:
If all else fails, just create a dummy tablix in between the two tablixes that you wish to insert a page break. Have that tablix be one row, one column long and have its dataset be something like "select ' ' as EmptyDataset". Make that "in between tablix" have a "Page Break After" setting. Viola - the export works fine in Excel, and you can't see the "in between tablix". If the tablix is set to hidden, I don't believe the Page Break will work successfully.
来源:https://stackoverflow.com/questions/20189803/the-row-item-structure-object-corresponding-to-a-line-cannot-be-null