带有矩阵和列表的 SSRS 2005 在打印或导出为 PDF 时显示每个数据页之间的空白页
我正在使用 SQL Server Reporting Services 2005 - 我创建了一份 8.5 英寸 x 11 英寸的纵向 A4 报告。
报告由页眉、正文和页脚组成。
正文由许多 2 列布局的文本框组成,在它们下面有一个放置在列表上的矩阵。
该矩阵由 2 个固定行(顶部行有 1 个固定文本列,底部行有 2 个数据集字段列)和多个列(每列宽度为 0.875 英寸,数据取自不同数据集字段)组成。我在列表中使用组表达式 =Ceiling(RowNumber(Nothing)/5),使矩阵列每 5 个重复列都从前一个列的下方开始。
我面临的问题是,如果矩阵跨越一页以上的数据,当我将报告导出为 PDF 或物理打印报告时,每页报告数据之间都会出现空白页(仅包含页眉和页脚)。页面上有足够的空间容纳矩阵的列。我已尝试以下操作,但无济于事:
1)我检查了页面宽度(8.5英寸)>=主体宽度(7.20833英寸)+左边距(0)+右边距(0)
2)我检查了页面高度(11in) >= Page.TopMargin (0) + Header.Height (2in) + Body.Height (6.60417in) + Footer.Height (0.89583in) + Page.BottomMargin (0)
3) 我尝试了各种边距值,范围从 0 英寸到 0.5 英寸(左、右、上、下边距)。
4)我将所有文本框的 CanGrow 属性设置为 false。这也会产生在无法容纳文本时将其剪掉的不良效果,但即便如此,空白页问题仍然会出现。
5)我将列表和矩阵放在一个矩形中,矩形外部有空白区域(矩阵右侧)。
阻止空白页出现的唯一方法是将列表分组表达式更改为 =Ceiling(RowNumber(Nothing)/2),即使矩阵每 2 个重复列(而不是 5 个)开始一个新的“表”。然而,我不明白这一点,因为右边有足够的空间容纳其他 3 列,而只放 2 列是奇怪和不整洁的!
我将非常感谢任何帮助! 提前致谢! 蒂姆
I am using SQL Server Reporting Services 2005 - I have created a portrait A4 report 8.5in by 11in.
The report consists of a header, body and a footer.
The body consists of a number of textboxes in a 2 column layout and underneath them a matrix placed onto a list.
The matrix consits of 2 fixed rows (with 1 fixed textual column in the top row and 2 dataset field columns in the bottom one) and a number of columns (each with a width of 0.875in and data taken from different dataset fields). I use the group expression =Ceiling(RowNumber(Nothing)/5) on the list, to make the matrix columns start below the previous ones every 5 repeated columns.
The problem I am facing is that a blank page (with only header and footer) is appearing between every page of report data when I export the report to PDF or print it physically, if the matrix spans more than one page of data. There is plenty of room for the columns of the matrix on the page. I have tried the following, but to no avail:
1) I checked that Page Width (8.5in) >= Body Width (7.20833in) + Left Margin (0) + Right Margin (0)
2) I checked that Page Height (11in) >= Page.TopMargin (0) + Header.Height (2in) + Body.Height (6.60417in) + Footer.Height (0.89583in) + Page.BottomMargin (0)
3) I played around with various margin values, ranging from 0in to 0.5in for the left, right, top and bottom margins.
4) I set all textboxes' CanGrow property to false. This also has the undesirable effect of chopping out the text when it cannot fit, but even so, the blank page problem still occurs.
5) I placed the list and the matrix together in a rectangle with the blank space (to the right of the matrix) outside the rectangle.
The only thing that stops the blank pages from appearing is changing the list grouping expression to =Ceiling(RowNumber(Nothing)/2), i.e. make the matrix start a new "table" every 2 repeated columns (rather than 5). This, however, I do not understand, as there is plenty of space for 3 other columns to their right and it is odd and untidy to just put 2!!
I would greatly appreciate any help in this!
Thanks in advance!
Tim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于在 SSRS 2008 中遇到类似问题的任何人,我发现解决此问题的唯一方法是将报表本身上名为
ConsumeContainerWhitespace
的属性设置为true
。就我而言,问题是页面上的矩阵在设计模式下很窄,右侧有很多空白。渲染时,矩阵被渲染得更宽(由于数据),但渲染器也会包含空白,导致报表比实际页面宽得多。
如果设置此属性,则不会呈现额外的空白。
For anybody who is having a similar problem in SSRS 2008, I found the only way to fix this was to set the property named
ConsumeContainerWhitespace
on the Report itself totrue
.In my case the issue was that the matrix on the page was narrow in design mode with a lot of whitespace to the right. When rendered, the matrix was rendered much wider (due to the data) but the renderer would also include the whitespace, causing the report to be much wider than the actual page.
If you set this property, the extra whitespace does not get rendered.
如果我理解正确的话,我之前已经解决过这个问题。矩阵要求额外的空白,我使用的解决方案如下:
您需要消耗空白。
[------页面宽度------]
[matrix][-textbox hack-]
我认为你可以将文本框设置为不可见
注意:当我在 2005 年尝试此操作时,它仅在不可见文本框跨越整行时才有效。
If I understand you correctly I've solved this problem before. The matrix claims extra white space, the solution I used is as follows:
You need to consume the white space.
[-------page width------]
[matrix][-textbox hack-]
I think you can set the textbox to be invisible
Note: When I attempted this in 2005, it only worked when the invisible textbox spanned the entire line.