Disable first screen exporting pdf

edited 10:46PM in FastReport 4.0
When I click on export pdf, I see the first screen (Export to pdf), then second screen(Save As). Is there away that I can disbale the first screen and keep second screen? If I set ShowDialog := False, then both srceen are disabled.

Thanks

Comments

  • gpigpi
    edited 10:46PM
    Try
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, frxClass, frxExportPDF, frxPreview, frxDsgnIntf, Menus;
    
    type
      TForm1 = class(TForm)
        frxReport1: TfrxReport;
        frxPDFExport1: TfrxPDFExport;
        SaveDialog1: TSaveDialog;
        procedure FormCreate(Sender: TObject);
        procedure frxReport1Preview(Sender: TObject);
        procedure PDFExport(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    
    {$R *.dfm}
    
    procedure TForm1.PDFExport(Sender: TObject);
    begin
         if SaveDialog1.Execute then
           begin
             frxPDFExport1.FileName:=SaveDialog1.FileName;
             TfrxPreview(frxReport1.Preview).Export(frxPDFExport1);
           end;
    end;
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
         frxPDFExport1.ShowDialog := False;
         frxReport1.ShowReport;
    end;
    
    procedure TForm1.frxReport1Preview(Sender: TObject);
    var i, j, mi: integer;
    begin
           TfrxPreviewForm(frxReport1.PreviewForm).PdfB.OnClick:=PDFExport;
           for i := 0 to frxExportFilters.Count - 1 do
             begin
               if TfrxCustomExportFilter(frxExportFilters[i].Filter).ClassName = 'TfrxPDFExport' then
                 mi:=i;
             end;
           TfrxPreviewForm(frxReport1.PreviewForm).ExportPopup.Items[mi].OnClick:=PDFExport;
           for i:=0 to TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items.Count-1 do
             begin
               if TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i].Caption=TfrxPreviewForm(frxReport1.PreviewForm).ExportB.Hint then
                 begin
                   for j:=0 to TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i].Count-1 do
                     if TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i][j].Caption=TfrxPreviewForm(frxReport1.PreviewForm).ExportPopup.Items[mi].Caption then
                        TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i][j].OnClick:=PDFExport;
                 end;
               if TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i].Caption=TfrxPreviewForm(frxReport1.PreviewForm).PdfB.Hint then
                 TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i].OnClick:=PDFExport;
             end;
    end;
    
    end.
    
  • edited 10:46PM
    gpi wrote: »
    Try
               if TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i].Caption=TfrxPreviewForm(frxReport1.PreviewForm).ExportB.Hint then
    

    comment: This code work when 'ExportB.' is omitted

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.