Home End User

SubReport Blank Pages

edited April 2003 in End User
I am having a problem with a subreport that prints a blank page when there
is no data in its pipeline. The report was designed in the End-User
environment. It is set up to always display in the Print Preview screen and
then allow the user the option to print the report after reviewing it. I
have looked at various postings related to this problem here and in the
other forums but have not been able to get this page to stop printing or to
print a "no data" caption on the page.



The report actually has two subreports. There is a main report page with
only a detail band that holds the first subreport. This subreport has a
second subreport in its summary band. Each subreport is set up as a section
and prints only one page. The second subreport sometimes will have no data.
I have tried modifying certain properties like changing the sections to
DynamicHeight. I have also set up a pass thru function to change the
NoDataBehaviors property to ndMessageOnPage but I always get the blank page.
Is there a specific code example to show how to control this behavior?



G. Mitchell

Comments

  • edited April 2003
    Here is an example for what I think you want to do. You don't need a pass
    through function to get this to work. All it does is display a draw command
    where the subreport was going to print (when it has no data to print) and
    the report continues printing the next record. No extra page is generated.

    http://www.digital-metaphors.com/tips/SubreportOnNoData.zip


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited April 2003
    Jim,



    I tried opening your project but got a number of errors like: "Error reading
    ppReport1.OutlineSettings.CreateNode: Property does not exist." Do I have a
    version problem here? I am still on Delphi 5.0 with Rbuilder 6. Am I trying
    to do something that I can't do with my version? I don't intend to upgrade
    Delphi until the "real" .NET version is released.

  • edited April 2003
    I'm using RB 7.02. If you ignore the errors you should be able to open an RB
    7 report template in RB 6. The problem is that you can't open the TForm in
    D5, because I created it using D6. I've added a template in the download, so
    try the download again and just load the template into a empty report on a
    form in Delphi. That way you don't have to contend with a form being opened
    in D5 that was created in D6.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited April 2003
    Thanks Jim,



    I got it to work. My big problem was not reading the NoDataBehaviors
    documentation with care. I missed the fact that ndMessageOnPage only works
    with ndBlankReport.

This discussion has been closed.