zoukankan      html  css  js  c++  java
  • [转]ConsumeContainerWhitespace property to remove blank space in SSRS 2008 report

    转自: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.

    ConsumeContainerWhitespace Property

    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

  • 相关阅读:
    idea 使用jedis连接不上 redis解决办法
    EFCore 连接 MySql 间歇性报错:你的主机中的软件中止了一个已建立的连接
    初学Ansible(管理Window主机)
    茹炳晟-API自动化测试笔记
    Xpath路径
    kibana Dev Tools --常用命令
    kibana Dev Tools--修改语句示例
    kibana Dev Tools--增删改查语句
    记一次出名记录
    脚本:bat实现自动转换windows远程端口
  • 原文地址:https://www.cnblogs.com/msdynax/p/3949634.html
Copyright © 2011-2022 走看看