How to add SSRS page break after 65536 rows, counting group header/footer

允我心安 提交于 2020-01-12 08:03:46

问题


I have an SSRS report which is failing to export to excel when the row count is greater than the Excel 2003 limit of 65536

The report already has a grouping level with a group footer.

I have tried to add an extra grouping level with a page break on the expression

=ceiling(rownumber(nothing)/65536)

However, this counts the detail rows, but does not take into account the group footer. So the rownumber evaluates to 53000 while the actual number of rows has exceeded 65536.

The following expression

=ceiling(RunningValue(Fields!myfirstgroup.Value, CountDistinct, Nothing) + rownumber(nothing) / 65536 )

will give me the actual row count including the group footers, but SSRS will not allow a group on a running value expression.

How can I force a page break after 65536 rows to allow an export to Excel? I had hoped to accomplish this in the report definition, and avoid adding a calculated page number in the query .

Any help much appreciated

* UPDATE - Sample data *

ItemDescription , Location , Quantity

Red lorry , M25 , 5

Red lorry , M6 , 2

Yellow lorry , M1 , 3

Report has a grouping on ItemDescription with a total for that item, so it will show

ItemDescription , Location , Quantity

    Red lorry , M25 , 5

    Red lorry , M6 , 2

      Total for Red Lorry,7

    Yellow lorry , M1 , 3

      Total for Yellow Lorry,3

This means from my 3 rows of data, I have 5 report rows including detail and footer rows. SSRS can tell how many details rows are in my dataset, but I need to take the footers into account for a page break.


回答1:


Hi this link might help you. I had similar sort of issue, a few years back.

SSRS Page break on Tablix with Rownumber ,just one row group and no group expression given by default

=Floor((RowNumber(Nothing)-1)/2000)

was the suggested answer




回答2:


Create a group with the following expression: =CInt(Ceiling(RowNumber(nothing)/65000))

The 65000 give you a little extra room for any headers or footers. Next, do a Page Break on this group "Between each instance of a group" and "Also at the end of a group" and you will successfully beat the excel file limit issue.

This is what we normally use without any issue. I don't think any one will notice if you don't specifically use all 65,536 rows.



来源:https://stackoverflow.com/questions/19003153/how-to-add-ssrs-page-break-after-65536-rows-counting-group-header-footer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!