Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Delphi Fastreport PDF Erstellen stürtzt ab (https://www.delphipraxis.net/197389-fastreport-pdf-erstellen-stuertzt-ab.html)

franktron 3. Aug 2018 10:42

Fastreport PDF Erstellen stürtzt ab
 
Ich habe ein Notebook (Windows Profil) habe letztens das Notebook durch einen neuen ersetzt

Wenn ich Drucken oder eine Vorschau mache geht alle, wenn ich aber eine PDF erzeugen mit frxPDFExport will bekomme ich eine Zugriffsverletzung.

Hier der Code an dem ich glaube das das Problem liegt.

Ich kann leider kein madexcept nutzen da das Projekt noch mit Delphi 2006 und Fastreport 6 erstellt ist.

Delphi-Quellcode:
If Header.Typ='TfrxPictureView' then
               Begin
                  v2:=TfrxPictureView.Create(B1);
                  S1.Seek(0,0);
                  v2.LoadFromStream(S1);
                  v2.Name:='Firmenkopf_'+IntToStr(i);
            If Header.Name='Picture_Background' then
            Begin
              v2.Name:='Picture_Background';
              with v2 do
              begin
                Left:= -(report.Pages[1] as TfrxReportPage).LeftMargin * fr01cm;
                Top:= -(report.Pages[1] as TfrxReportPage).TopMargin * fr01cm;
                Width:= (report.Pages[1] as TfrxReportPage).PaperWidth * fr01cm;
                Height:= (report.Pages[1] as TfrxReportPage).PaperHeight * fr01cm;
              end;
            End;
               End;

mkinzler 3. Aug 2018 10:55

AW: Fastreport PDF Erstellen stürtzt ab
 
Ich würde, auch wenn es vielleuicht nichts mit dem Problem zu tun hat
Delphi-Quellcode:
              with v2 do
              begin
                Left:= -(report.Pages[1] as TfrxReportPage).LeftMargin * fr01cm;
                Top:= -(report.Pages[1] as TfrxReportPage).TopMargin * fr01cm;
                Width:= (report.Pages[1] as TfrxReportPage).PaperWidth * fr01cm;
                Height:= (report.Pages[1] as TfrxReportPage).PaperHeight * fr01cm;
end;
durch
Delphi-Quellcode:
        v2.Left:= -(report.Pages[1] as TfrxReportPage).LeftMargin * fr01cm;
                v2.Top:= -(report.Pages[1] as TfrxReportPage).TopMargin * fr01cm;
                v2.Width:= (report.Pages[1] as TfrxReportPage).PaperWidth * fr01cm;
                v2.Height:= (report.Pages[1] as TfrxReportPage).PaperHeight * fr01cm;
ersetzen.

haentschman 3. Aug 2018 10:58

AW: Fastreport PDF Erstellen stürtzt ab
 
Zitat:

Hier der Code an dem ich glaube das das Problem liegt.
Delphi-Quellcode:
with v2 do
  begin
    Left:= -(report.Pages[1] as TfrxReportPage).LeftMargin * fr01cm;
    Top:= -(report.Pages[1] as TfrxReportPage).TopMargin * fr01cm;
    Width:= (report.Pages[1] as TfrxReportPage).PaperWidth * fr01cm;
    Height:= (report.Pages[1] as TfrxReportPage).PaperHeight * fr01cm;
  end;
Left, Top, Width, Height... soll der Compiler die aus v2 oder der Form benutzen? :wink: Das ist genau ein Beispiel warum man with wegläßt. :wink:

franktron 3. Aug 2018 13:45

AW: Fastreport PDF Erstellen stürtzt ab
 
Zitat:

Zitat von haentschman (Beitrag 1409605)
Zitat:

Hier der Code an dem ich glaube das das Problem liegt.
Delphi-Quellcode:
with v2 do
  begin
    Left:= -(report.Pages[1] as TfrxReportPage).LeftMargin * fr01cm;
    Top:= -(report.Pages[1] as TfrxReportPage).TopMargin * fr01cm;
    Width:= (report.Pages[1] as TfrxReportPage).PaperWidth * fr01cm;
    Height:= (report.Pages[1] as TfrxReportPage).PaperHeight * fr01cm;
  end;
Left, Top, Width, Height... soll der Compiler die aus v2 oder der Form benutzen? :wink: Das ist genau ein Beispiel warum man with wegläßt. :wink:

Das script ist aus einer Unit und keine Form weit und breit :)


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:26 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz