How to force a textbox to split, rather than move to a second page in SSRS 2005 (PDF Export)?

久未见 提交于 2019-12-22 10:26:56

问题


This question is a follow up to my original question, I've done a bit more reseach, i narrowed a problem down quite a bit.

I've also uploaded a sample .rdl to illustrate the problem

I've got the following report setup: a header (image in the body), two textboxes, and a footer.

First textbox has a little bit of text, and second textbox has lots of text. Second textbox can fit on one page by itself, but won't fit on the page with my header and the first textbox.

The problem is that for some reason, the second textbox in the report is unaware of other contents of that same report, and as long as that one textbox fits on one page - it will be moved to the second page. (once the textbox grows larger than 1 page - it will split, and will achieve the desired behavior)

Desired behavior is to split the second textbox, and keep as much text on the first page as possible, and move the rest to the second page.


回答1:


This is pretty standard behaviour in SSRS. Like many issues with the Reporting engine, you have to trick it.

In this case you could try to provide the 'lines' for the second text box as individual rows in a Detail, then use a repeater or table to display them. Alternatively you could break on 'paragraph'. Unfortunately you'll have to do this in your data source, probably in a stored procedure, depending on how you're getting the data to the report.

If appropriate you could look at client-side reporting (.rdlc files), which allows you to pre-process the data in a .NET application, although setting up for printing can be more complex.




回答2:


I'm not sure about v.2005 but in v.2008 you can set a textbox property: KeepTogether to false.

This will fit as much text on the first page than the rest on the second page.



来源:https://stackoverflow.com/questions/1355648/how-to-force-a-textbox-to-split-rather-than-move-to-a-second-page-in-ssrs-2005

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