我有两页的SSRS报告。当我将它导出为PDF时,由于它的宽度,它需要4页,其中第2和第4页显示了我从表格中的一个字段。我试图在报告属性中设置布局大小为宽度=18英寸,高度=8.5英寸。

它在一页PDF中给了我整个表格,但我仍然得到第2页和第4页空白。

我做的方法不对吗?我还能怎么摆脱这些空白页呢?


当前回答

另一件要尝试的事情是将名为ConsumeContainerWhitespace的报告属性设置为True(默认为false)。我就是这样解决的。

其他回答

If your report includes a subreport, the width of the subreport could push the boundaries of the body if subreport and hierarchy are allowed to grow. I had a similar problem arise with a subreport that could be placed in a cell (spanning 2 columns). It looked like the span could contain it in the designer and it rendered fine in a winform or a browser and, originally, it could generate printer output (or pdf file) without spilling over onto excess pages. Then, after changing some other column widths (and without exceeding the body width plus margins), the winform and browser renderings looked still looked fine but when the output (printer or pdf) was generated, it grew past the margins and wrote the right side of each page as a 2nd (4th, etc.) page. I could eliminate my problem by increasing colspan where the subreport was placed. Whether or not you're using subreports, if you have page spillover and your body design fits within the margins of the page, look for something allowed to grow that pushes the width of the body out.

你有没有看一下你的报告右边是否有空白处?如果是这样,您可以将它拖回报表的末尾,然后将报表背景拖回相同的位置。

在编辑SSRS文档时,最好先在设计面上(Visual Studio 2012显示,但可以在其他版本中完成)进行计算。

下面红圈内的数字对应以下步骤:

In the design surface, sometimes the editor will create a page which is larger than the actual controls; hence the ghost area being printed. Resize to the controls. Visually look at the width/height and see if you can't bring in the page on the design surface to size it to the space actually needed by the controls and no more. Then try to create a PDF and see if that fixes it. If #3 does not resolve the issue, then there are controls requiring too much of the actual page size and going over in either length/width. So one will need to make the size of the controls smaller to accommodate a smaller page size.


此外,在某些情况下,可以通过将ConsumeContainerWhitespace设置为true来更改报表页面的属性,从而自动使用这些空间。

在商业改进方案或SSDT-BI中,请执行以下操作:

点击报告>报告属性>布局选项卡(SSDT-BI中的页面设置选项卡) 请注意页面宽度,左距,右距的值 关闭并返回设计图面 在“属性”窗口中,选择主体 单击“+”符号展开“大小”节点 记录Width的值

要在PDF中正确呈现,正文宽度+左边距+右边距必须小于或等于页面宽度。当你看到空白页被渲染时,几乎总是因为主体宽度加上页边距大于页面宽度。

请记住:(正文宽度+左距+右距)<=(页面宽度)

对我来说,问题是SSRS故意对待你的空白,就好像你想让它得到尊重一样:

和空白一样,确保没有右边距。