转自:http://beyondrelational.com/modules/2/blogs/115/posts/11153/consumecontainerwhitespace-property-to-remove-blank-space-in-ssrs-2008-report.aspx

While at starting with SSRS, everybody face the problem of unnecessary blank pages at end. Me and my friend Chirag (Blog) had faced this problem many times and got defects from QA in past for balnk pages.

In SSRS 2005, white spaces are automatically ignored. But in 2008 this behavior gets changed and by default whitespaces are not ignored.  But, There is Report property ConsumeContainerWhitespace which is set to False by default. We can remove blank space at end by setting ConsumeContainerWhitespace to true.

The logic to prevent the unnecessary pagebreak is 
- ReportBody width should be less then Pagesize(width) – Left Margin – Right Margin
- ReportBody height should be less then Pagesize(Height) – Top Margin – Bottom Margin – Header height – Footer height

Sometimes, report is as per these conditions and still we get blank pages.

Problem -1 If we have some space at the bottom or right side after Tablix, sometimes we get blank page at the end based on rows we get from dataset. In this case, We can get rid of that blank page by removing that un-necessary space at end.

Problem-2 In case of matrix report, we can’t remove that space (otherwise page header and footer items like page numbers are not aligned properly at bottom left) and we used to get bank page. We can see this in below example (Same report is attached herewith),

Setp-1 Dataset Query

1.USE AdventureWorksDW
2.SELECT CountryName = dg.EnglishCountryRegionName
3., SalesAmount = SUM(fs.SalesAmount)
4.FROM dbo.FactInternetSales FS
5.INNER JOIN dbo.DimGeography dg on FS.SalesTerritoryKey = dg.SalesTerritoryKey
6.GROUP BY dg.EnglishCountryRegionName
7.ORDER BY dg.EnglishCountryRegionName

Step-2  Create matrix report with CounrtyName as columnGrouping value and set the column width to 25mm

Setp-3 Set following properties. 
Report Body Height:- 7in
Report Body Width:- 6in
Header and Footer  Height:  0.7in.
All four margins are of 1 in.
Report Height:- 11in
Report  Width:- 8.5in

Setp-4 Add a page-number in footer at bottom right.

Setp-5 Run a report and export to PDF.
We will get the blank page at end.

Step-6 Set ConsumeContainerWhitespace to true in report property as shown below.

Step-7 Run Report and export to PDF

Now, There will not be blank pages at end.

References
http://msdn.microsoft.com/en-us/library/ms143200.aspx

[转]ConsumeContainerWhitespace property to remove blank space in SSRS 2008 report的更多相关文章

  1. 我们都遇到过的 Replace Blank Space

    题目描述: 请实现一个函数,将一个字符串中的空格替换成“%20”.例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy. 分析: 看到这个题目,我们都会有 ...

  2. [Papers]NSE, $u_3$, Lebesgue space [Cao-Titi, IUMJ, 2008]

    $$\bex u_3\in L^p(0,T;L^q(\bbR^3)),\quad \frac{2}{p}+\frac{3}{q}=\frac{2}{3}+\frac{2}{3q},\quad \fra ...

  3. 【转】The magic behind array length property

    Developer deals with arrays every day. Being a collection, an important property to query is the num ...

  4. Entity Framework工具POCO Code First Generator的使用

    在使用Entity Framework过程中,有时需要借助工具生成Code First的代码,而Entity Framework Reverse POCO Code First Generator是一 ...

  5. EntityFramework4.1 MODEL代码生成器 database first

    原文发布时间为:2011-04-02 -- 来源于本人的百度文章 [由搬家工具导入] Generating EF Code First model classes from an existing d ...

  6. Entity Framework工具POCO Code First Generator的使用(参考链接:https://github.com/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator)

    在使用Entity Framework过程中,有时需要借助工具生成Code First的代码,而Entity Framework Reverse POCO Code First Generator是一 ...

  7. Kubernetes deployed on multiple ubuntu nodes

    This document describes how to deploy kubernetes on multiple ubuntu nodes, including 1 master node a ...

  8. 10 Things Every Java Programmer Should Know about String

    String in Java is very special class and most frequently used class as well. There are lot many thin ...

  9. Jenkins 2.7.3 LTS 发布

    更新如下: Stop A/B testing of the remoting JNLP3 protocol due to the known issues. The protocol can be e ...

随机推荐

  1. ViewFlipper、ViewPager和Gallery

    1.ViewFlipper 1)View切换的控件—ViewFlipper介绍 ViewFilpper类继承于ViewAnimator类.而ViewAnimator类继承于FrameLayout. 查 ...

  2. WPF--Blend制作Button控件模板

    博客园新人,WPF初学者.不涉及理论知识,直接进入操作. 记录一下使用Blend制作Button控件模板过程中,学到Blend几个知识点: 1.渐变画笔编辑器的Alpha选项可以调控件的透明度.即下图 ...

  3. javascript设计模式学习之三—闭包和高阶函数

    一.闭包 闭包某种程度上就是函数的内部函数,可以引用外部函数的局部变量.当外部函数退出后,如果内部函数依旧能被访问到,那么内部函数所引用的外部函数的局部变量就也没有消失,该局部变量的生存周期就被延续. ...

  4. css页面布局

    写在前面: 页面布局整体上可以分为两类:固定宽度(一般固定960px):流式布局:将流式布局转换为固定布局很容易,只需要外围再包括一个div,为其设置宽度即可. html默认的布局方式是将每个块状标签 ...

  5. 如何激活一个window/dialog && 不能直接对Dialog Box使用SetFocus

    问题,症状: 程序的主窗口CMainWnd创建了一个modal dialog,希望这个dialog能接收WM_KEYDOWN消息,但是需要点一下这个dialog窗口它才能接收到(我嫌麻烦),而且我发现 ...

  6. IOS Certificates 制作流程 (Adobe FlashBuilder)

    看到一个Adobe 官方的PDF 说的非常明白,比自己一步一步总结的要好多了 怎么生成 以及为何生成都有说明 http://help.adobe.com/en_US/ppcompdoc/Adobe_P ...

  7. ORACLE 12C PDB 维护基础介绍

    来自:http://www.xifenfei.com/2013/05/oracle-12c-pdb-%E7%AE%A1%E7%90%86%E4%BB%8B%E7%BB%8D1.html CDB和PDB ...

  8. java中的BigDecimal和String的相互转换

    /*由数字字符串构造BigDecimal的方法 02.*设置BigDecimal的小数位数的方法 03.*/ 04.import java.math.BigDecimal; 05.//数字字符串 06 ...

  9. Codeforce Round #218 Div2

    A:没个元素的个数少的变成多的和就是了 B:居然被systemtest搓掉了- -分东西,我改的代码,还是shit一样的过的...别人的直接两个操作数相减就可以了! C:二分题- -,没想到比赛时因为 ...

  10. GC是什么? 为什么要有GC?

    GC是什么? 为什么要有GC?  GC是垃圾收集器.  程序员不用担心内存管理,因为垃圾收集器会自动进行管理.要请求垃圾收集,可以调用下面的方法之一:  System.gc() Runtime.get ...