Print header, MasterData and Footer if DataSet empty

stefquestefque Serbia
edited 10:38AM 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 10:38AM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.