Microsoft KB Archive/938943

From BetaArchive Wiki
Knowledge Base


Blank space appears in the file when you export a report to a physical page format file in SQL Server 2005 Reporting Services or in SQL Server 2000 Reporting Services

Article ID: 938943

Article Last Modified on 7/9/2007



APPLIES TO

  • Microsoft SQL Server 2000 Reporting Services
  • Microsoft SQL Server 2005 Reporting Services




SYMPTOMS

In Microsoft SQL Server 2005 Reporting Services or in Microsoft SQL Server 2000 Reporting Services, blank space appears in a file that you export. This problem occurs if the following conditions are true:

  • You export the report to a physical page format file, such as a PDF document or an image file.
  • The report contains a subreport.

Additionally, blank space appears in the preview report when you preview the report before you print it.

CAUSE

This behavior occurs because the Subreport control has an implicit KeepTogether property. By design, the KeepTogether property tries to keep content of a subreport on one page. Because of this behavior, the report engine creates blank space on the main report if the subreport does not fit on the same page as the main report. Then, the report engine creates the subreport on a new page.

WORKAROUND

To work around this behavior, follow these steps:

  1. Make sure that your report does not use the Subreport control.
  2. Move the data in the subreport into the main report.


STATUS

This behavior is by design.

MORE INFORMATION

Steps to reproduce the problem

  1. In SQL Server Business Intelligence Development Studio, create a report server project. To do this, follow these steps:
    1. Click Start, click Programs, click Microsoft SQL Server 2005, and then click SQL Server Business Intelligence Development Studio.
    2. On the File menu, click New, and then click Project.
    3. In the New Project dialog box, click Business Intelligence Projects under Project Types, and then click Report Server Project under Templates.
    4. In the Name box, type the name of the report project.
    5. In the Location box, type the location of the report project, and then click OK.
  2. Create a new report definition file. To do this, follow these steps:
    1. In Solution Explorer, right-click Reports, click Add, and then click New Item.
    2. In the Add New Item dialog box, click Report under Templates.
    3. In the Name box, type the name of the report, and then click Add.

      Note The Report Designer opens and displays the new .rdl file in the Data view.
  3. Set up connection information. To do this, follow these steps:
    1. On the Data tab, expand the contents of the Dataset list, and then select New Dataset. The Data Source dialog box appears.
    2. In the Name box, type AdventureWorks.
    3. In the Type box, select Microsoft SQL Server.
    4. In the Connection string box, type the following, and then click OK:

      Data source=(local); initial catalog=AdventureWorks
  4. Create a report. To do this, follow these steps:
    1. On the <ReportName>[Design]* page, click the Layout tab.
    2. On the toolbox, click the <ReportName> control to put the Subreport control on the designer. Then, click the designer.

Notice that the Properties dialog box does not display the KeepTogether property. Therefore, the subreport uses the implicit behavior of the KeepTogether property.

Keywords: kbtshoot kbprb KB938943