How to identify it as a print in PDF format?

edited 9:11AM 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 9:11AM
    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 9:11AM
    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

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.