Print header, MasterData and Footer if DataSet empty

stefquestefque Serbia
edited 7:40PM in FastReport 4.0
It think I've red everything here and even tried everything I could think of, but it just won't work.
What should I do to get Fast Report to print header, Master Data and footer on the page if there are no lines in my query? I need to have at least one line printed, sowing the design and column names in header....
It's a simple page that has only these 3 things, and I get an empty page...

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 7:40PM
    it is simple use the engine.showband method.
    read the usermanual on using the engine object.
    typically
    on the code page
    var
    ds: TfrxDataSet;
    begin
    //this block of code runs first before any other.
    ds := Report.GetDataset('frxDBDataSet1');// use the username of the dataset
    if ds.recordcount = 0 then
    begin
    engine.showband(bandname);
    end.
  • stefquestefque Serbia
    edited January 2011
    Just in case someone has the same problem, one note from my side....
    It wouldn't work only like that for me, I had to adjust it for my needs and put it in a procedure, actually:

    procedure Page1OnManualBuild(Sender: TfrxComponent);

    which is given in the usermanual, but I didn't see it at first. Now everything works fine.

    Thanks gordk

    Addition to my post:
    I found out that when your making a onManualBuild procedure, you should also take care of the part when recordset is not 0. Because in that case you should tell the engine again to draw the bands.

Leave a Comment