How to identify it as a print in PDF format?

edited 12:16PM in FastReport VCL 5
How to identify it as a print in PDF format?

The report contains a field that tells me if the user wants to print the logo or not an invoice.

The following code gives me this:

GroupHeaderOnBeforePrint procedure (Sender: TfrxComponent);
begin
PictureLogo.Visible: <frxBDataset "SI_IMP_LOGO."> 'YES');
end

When printing a PDF, I want to always print logo.

The report contain a property that lets me know if it is an export to PDF?

Comments

  • gpigpi
    edited 12:16PM
    Modify frxClassRTTI.pas:
    AddEnum('TfrxFormatKind', 'fkText, fkNumeric, fkDateTime, fkBoolean');
    AddEnum('TfrxFillType', 'ftBrush, ftGradient, ftGlass');
    AddEnumSet('TfrxVisibilityTypes', 'vsPreview, vsExport, vsPrint'); //add this line
    
    Modify frxExportPDF.pas
    procedure TfrxPDFExport.ExportObject(Obj: TfrxComponent);
    begin
    if (Obj is TfrxView) and ((ExportNotPrintable and (not TfrxView(Obj).Printable)) or (vsExport in TfrxView(Obj).Visibility)) then
    AddObject(Obj as TfrxView);
    end;
    
    and use
    IF (<frxDBDataset."SI_IMP_LOGO"> = 'YES')
    then PictureLogo.Visibility := vsPreview + vsExport + vsPrint
    else PictureLogo.Visibility := vsPreview + vsExport;
    
  • edited 12:16PM
    Thanks gpi for the information. It helped me.
    It would be good if fast report add the visibility types to the RTTI.

Leave a Comment