[转]ConsumeContainerWhitespace property to remove blank space in SSRS 2008 report
2014-09-01 17:22
344 查看
转自: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
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
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
相关文章推荐
- char * strtrim(char* s ) to remove any space character(such as '\t' , ' ' ...) in a string
- Repeating Table Header on Each Page of the Report in the SSRS 2008
- SQL 2005 Reporting Services:物理分页和逻辑分页 SSRS 2008 report export to PDF - Cannot get size to work
- C# Tips: How to remove white-space characters inside a string?
- [Beginning Visual C++ 2008]to get rid of space in a string
- how to remove nil and blank string in an array in Ruby
- How to remove administrative shares in Windows Server 2008 or 2012
- How to grant permissions to a custom assembly that is referenced in a report in Reporting Services
- How to merge blank cells in one column in Office Excel?
- Modify in the AVL report,and refresh to the internal table
- 【翻译】Pro LINQ Language Integrated Query in C# 2008 -- 第三章 (LINQ TO Objects) 第二节
- Visual Studio 2008开发新特性系列课程(8):VSTO in Visual Studio 2008
- Adding links to a Panel container’s status text in Flex
- how to get the space size of some tables in one database?
- How to get the password text in a text with password property from another process using C++ - 用C++如何从不同进程获取密码框文本
- HOW-TO: Remove embedded HTML in CQWP roll-ups
- 【翻译】Pro LINQ Language Integrated Query in C# 2008 -- 第三章 (LINQ TO Objects) 第三节
- server 2 task(s) are sleeping waiting for space to become available in the log segment for database tempdb.
- How to install Active Directory in Server 2008 and Vista
- How to remove ^M in a uploaded text file?