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

  • 相关阅读:
    料理phpMyAdmin2.6以上版本数据乱码结果
    mysql 中字符集的选择
    关于MySQL中的mysqldump饬令的运用
    一些Mysql的优化经验
    MYSQL数据库初学者操作指南1
    MySQL 5.0 新特性教程 存储历程:第三讲
    Windows下MySQL PHP5的设置配备部署与phpBB2论坛的架设
    MySQL 5.0新特征教程 存储历程:第一讲
    MySQL 5.0 新特征教程 存储过程:第二讲
    Linux Apache Mysql PHP典范设置装备摆设1
  • 原文地址:https://www.cnblogs.com/msdynax/p/3949634.html
Copyright © 2011-2022 走看看