How to cancel/exit report from the script

Hi, I am new here. Sorry for stupid questions......

How to exit report from the script if for example the dataset is empty or if any other codition is met?

procedure frr4OnStartReport(Sender: TfrxComponent);
var i:integer;
begin
if MyVar=true
then
need to exit/cancel report here. How?
end;


At what stage DataSet is opening? How do I cancel report with the message if Dataset is empty?

Thanks a lot

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 7:20PM
    var
    ds: TfrxDataSet;
    begin
    ds := Report.GetDataset('frxDBDataSet1'); // username of dataset
    if ds.recordcount = 0 then report.close;
    end.

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.