Hallo
Ich bin gerade von VO2.8 auf X# umgezogen.
Beim Aufruf von Printview stürzt das Programm ab.
Das Vorschaufenster wird leer angezeigt und das Programm stürzt ohne Fehlermeldung ab.
DebugView zeigt folgendes an.
Ich setze NUR hardcodierte Ausdrucke ein.
// Mein nornaler Aufruf
// _mzei := "AB "+Left(_dbAUF_MAIN:FIELDGET(#ab_gesamt),5)+"-"+Right(_dbAUF_MAIN:FIELDGET(#ab_gesamt),2)
// oPrinter:PrintPreview(_mzei, "PRINT.PRN","Auftragsbestätigung", "Printing...",FALSE,FALSE,FALSE,sw_showmaximized, zoom_whole_page)
// Aufruf lt. Hilfe
_oPrinter:PrintPreview("Appname", "PRINT.PRN","Aufragsbestätigung", "Printing...",FALSE)
Der Ausdruck auf den Drucker (Pdf-Creater) funktioniert.
X# Version V 2.21
Reportpro2 V 2.43
Ich bin jetzt überfordert. <s>
Was kann ich machen?
Martin
Error PrintPreview b
Moderator: wriedmann
Re: Error PrintPreview b
Martin,
ich habe nur gedesignerte Reports im Einsatz, drum schlecht vergleichbar.
funktioniert bei mir.
Deinen Screenshot kann man leider nicht soweit zoomen, dass man was lesen könnte...
ich habe nur gedesignerte Reports im Einsatz, drum schlecht vergleichbar.
Code: Select all
METHOD Print_Umschlag_RPT()
//SELF:PrintReportRPT("20120820_Umschlag.RPT")
LOCAL oReport AS RpReportRDD
LOCAL cReport := "20120820_Umschlag" AS STRING
oReport :=RpReportRDD{ SELF, SELF:cRptbase +cReport +".rpt", DataNetPath, Null_Array}
IF ALen(SELF:aChildWindows) > 0 // wenigstens ein Datawindow ist offen
IF oReport:IsValid
LOCAL cFilterexpression:= SELF:aChildWindows[1]:PNo AS STRING
IF cFilterexpression != ""
??? oReport:FilterExpression := i"Person.PNo = '{cFilterexpression}' "
ENDIF
// oReport:PrintPreview(cJobName,cPrint2Filename,cCaption,cMessage, TRUE,;
;//SW_SHOWNORMAL, ZOOM_WHOLE_PAGE, #rpPrintPreviewDLG)
//0,0, Null_Symbol)
oReport:PrintPreview("","","","", TRUE,0,0, Null_Symbol)
oReport:Close()
ENDIF
ELSE
Meldung("Fehler", "Keine Personfenster geöffnet!")
ENDIF
RETURNDeinen Screenshot kann man leider nicht soweit zoomen, dass man was lesen könnte...
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Re: Error PrintPreview b
Hallo Karl
Ich habe deinen Aufruf getestet.
_oPrinter:PrintPreview("","","","", TRUE,0,0, Null_Symbol)
error XS1503: Argument 6: cannot convert from 'int' to 'logic' 437,58 RepAuftragsBest.prg ReportAuftragsBest:.ctor
error XS1503: Argument 7: cannot convert from 'int' to 'logic' 437,60 RepAuftragsBest.prg ReportAuftragsBest:.ctor
error XS1503: Argument 8: cannot convert from 'symbol' to 'int' 437,63 RepAuftragsBest.prg ReportAuftragsBest:.ctor
Lt Hilfe
<oPtrDevice>:PrintPreview(cJobName, cPrint2File, cCaption, cMessage, [lModal], [lPreBody], [lPostBody], [nShowState], [lZoomed], [symPPWindow])
müsste das Argument 8 auch Logic sein.
Aber auch
_oPrinter:PrintPreview("","","","", TRUE,TRUE,TRUE,1)
führt zum Absturz
Wenn ich inter Github Rp2Net/Sample, ReportPro2, Sql schaue lautet der Aufruf
/Run SQL Report.prg
SELF:oRpReport:PrintPreview("ReportPro Test Utility","PRINT.PRN",alltrim(SELF:oDCRptNameEdit:TextValue),"Please Wait...Printing in Progress",TRUE,0, 0, NULL_SYMBOL)
Würde als deinem Beispiel entsprechen.
Martin
Ich habe deinen Aufruf getestet.
_oPrinter:PrintPreview("","","","", TRUE,0,0, Null_Symbol)
error XS1503: Argument 6: cannot convert from 'int' to 'logic' 437,58 RepAuftragsBest.prg ReportAuftragsBest:.ctor
error XS1503: Argument 7: cannot convert from 'int' to 'logic' 437,60 RepAuftragsBest.prg ReportAuftragsBest:.ctor
error XS1503: Argument 8: cannot convert from 'symbol' to 'int' 437,63 RepAuftragsBest.prg ReportAuftragsBest:.ctor
Lt Hilfe
<oPtrDevice>:PrintPreview(cJobName, cPrint2File, cCaption, cMessage, [lModal], [lPreBody], [lPostBody], [nShowState], [lZoomed], [symPPWindow])
müsste das Argument 8 auch Logic sein.
Aber auch
_oPrinter:PrintPreview("","","","", TRUE,TRUE,TRUE,1)
führt zum Absturz
Wenn ich inter Github Rp2Net/Sample, ReportPro2, Sql schaue lautet der Aufruf
/Run SQL Report.prg
SELF:oRpReport:PrintPreview("ReportPro Test Utility","PRINT.PRN",alltrim(SELF:oDCRptNameEdit:TextValue),"Please Wait...Printing in Progress",TRUE,0, 0, NULL_SYMBOL)
Würde als deinem Beispiel entsprechen.
Martin
Re: Error PrintPreview b
Hallo Karl,
bei mir läuft folgender Syntax:
oReport:PrintPreview("Test","PRINT.PRN","Test","Bitte warten... Druck läuft ",TRUE,SHOWZOOMED,ZOOM_WHOLE_PAGE,NULL_SYMBOL)
Gruß Jörg
bei mir läuft folgender Syntax:
oReport:PrintPreview("Test","PRINT.PRN","Test","Bitte warten... Druck läuft ",TRUE,SHOWZOOMED,ZOOM_WHOLE_PAGE,NULL_SYMBOL)
Gruß Jörg
Re: Error PrintPreview b
Hallo
Hat leider nicht geklappt
Martin
Hat leider nicht geklappt
Martin
Re: Error PrintPreview b
Martin,
es gibt zwei Previews, die von "ptrDevice" und die von RpReport. Erstere hat bis zu 10 params, letztere 8 und dummerweise sind die 2 zusätzlichen NICHT "hinten" an die Argumentliste angehängt, sondern vor #7 eingefügt. Mein Verdacht ist, dass "Dein" Code ersteres nimmt, mit der Parameterreihenfolge der anderen Klasse, die "unsere" verwenden.
NB, hättest Du eine Link zu dem github sample - ich find da nix..
es gibt zwei Previews, die von "ptrDevice" und die von RpReport. Erstere hat bis zu 10 params, letztere 8 und dummerweise sind die 2 zusätzlichen NICHT "hinten" an die Argumentliste angehängt, sondern vor #7 eingefügt. Mein Verdacht ist, dass "Dein" Code ersteres nimmt, mit der Parameterreihenfolge der anderen Klasse, die "unsere" verwenden.
NB, hättest Du eine Link zu dem github sample - ich find da nix..
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Re: Error PrintPreview b
Hi Martin,
There's another parameter of the Printer:PrintPreview() method, for the preview window class as symbol. Please try passing this as NULL_SYMBOL, does it work like that?Tudorf wrote: Sat Feb 15, 2025 8:31 am oPrinter:PrintPreview(_mzei, "PRINT.PRN","Auftragsbestätigung", "Printing...",FALSE,FALSE,FALSE,sw_showmaximized, zoom_whole_page)
Code: Select all
oPrinter:PrintPreview(_mzei, "PRINT.PRN","Auftragsbestätigung", "Printing...",FALSE,FALSE,FALSE,sw_showmaximized, zoom_whole_page, NULL_SYMBOL)Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: Error PrintPreview b
Hello Chris
The programme can be compiled and then crashes without an error message. Just like in my first text with my old VO calls.
Do I have a wrong DLL or something?
Martin
The programme can be compiled and then crashes without an error message. Just like in my first text with my old VO calls.
Do I have a wrong DLL or something?
Martin
Re: Error PrintPreview b
Hi Martin,
As you said printing is working well, so the dlls must be correct. Unless you are missing some file. Where and when did you download RP for X# from?
One thing I would try is to run the app under the debugger, maybe this will give an error before the crash and will tell you exactly where it happens.
Another thing to try, is to create a small new test app, and add to it some very basic printing functionality, similar to what your real app does, but completely cut down, just print only a text or a line. If that works ok, then try adding more stuff, that the real app prints, until you find the culprit (when also your test app starts crashing).
As you said printing is working well, so the dlls must be correct. Unless you are missing some file. Where and when did you download RP for X# from?
One thing I would try is to run the app under the debugger, maybe this will give an error before the crash and will tell you exactly where it happens.
Another thing to try, is to create a small new test app, and add to it some very basic printing functionality, similar to what your real app does, but completely cut down, just print only a text or a line. If that works ok, then try adding more stuff, that the real app prints, until you find the culprit (when also your test app starts crashing).
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: Error PrintPreview b
Hallo
I received an error when calling.
What can I do?
Martin
I received an error when calling.
What can I do?
Martin

