Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Deutschsprachiges X#-Forum – German language forum

Moderator: wriedmann

User avatar
Heinrich
Posts: 33
Joined: Wed Feb 10, 2016 4:44 pm

Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Post by Heinrich »

Hallo zusammen

Aktuell habe ich zwei Probleme:
[*]
[*]Wenn ich im Report-Designer (RpReportDesigner) ein offenes Fenster "minimiere" kommt es zu einem Laufzeitfehler (siehe Anhang)
[*]Wenn ich mein Shellwindow von rpShellWindow ableite (oder darf man das nicht?) wird meine "QueryClose()" Routine 2x aufgerufen.


Punkt 1 kann mit "Rp2Net-main.zip" auf GitHub direkt nachvollzogen werden. Der Fehler ist jedoch auch in den älteren Varianten vorhanden.

Frage:
Habt Ihr diese Probleme nicht? Oder verwendet Ihr den "RpReportDesigner" nicht?

Gruss
Heinrich
Attachments
Laufzeitfehler im RpReportDesigner.png
Laufzeitfehler im RpReportDesigner.png (83.03 KiB) Viewed 353 times
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Post by Chris »

Hi Heinrich,

Normally both should work fine. Do you have a (complete) sample showing those problems?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
Heinrich
Posts: 33
Joined: Wed Feb 10, 2016 4:44 pm

Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Post by Heinrich »

Hi Chris
Yes, the original from Github (without modifications).Compile and Run with Microsoft Visual-Studio Community 2017, Version 15.9.37 see the attachement
Sample.mp4


For the 2the Example, change the "Start.prg" with this:

Code: Select all

USING System.Windows.Forms

[STAThread] ;
FUNCTION Start(aArgs AS STRING[]) AS VOID

   LOCAL oApp AS ReportPro2App
   EnableLBOptimizations(TRUE)
   TRY
      oApp:=ReportPro2App{}
      oApp:Start(aArgs)
      
   CATCH e AS Exception
      ErrorBox{ NIL, e:ToString() }:Show()
   END TRY

RETURN

    CLASS ReportPro2App INHERIT App
        PROTECT oShellWindow AS MyShellWindow	// rpShellWindow
        METHOD Start(aArgs as STRING[]) 
	        SetAnsi(FALSE)
            IF aArgs:Length > 0
*    	        oShellWindow:=rpShellWindow{SELF, FALSE}
    	        oShellWindow:=MyShellWindow{SELF, FALSE}
                oShellWIndow:OpenRptFile(aArgs[1])
            ELSE
                oShellWindow:=MyShellWindow{SELF, TRUE}
            ENDIF
	        SELF:Exec()
        	
        RETURN NIL
    	
    END CLASS


CLASS MyShellWindow				INHERIT rpShellWindow

CONSTRUCTOR(oApp)

	SUPER(oApp, FALSE)

RETURN

METHOD QueryClose()                                   
	LOCAL lEnde	    AS LOGIC

	lEnde := MessageBox.Show( "Wollen sie das Programm beenden?", "Programm Ende", MessageBoxButtons.YesNo, MessageBoxIcon.Question ) == DialogResult.Yes

RETURN lEnde


END CLASS
Then the "QueryClose()" is called twice

Regards Heinrich
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Post by Chris »

Hi Heinrich,

Unfortunately the attachment for the first problem is not accessible!

I do see the problem with QueryClose() though, thanks for the sample! Will fix the problem in RP2.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
FFF
Posts: 1522
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Post by FFF »

Chris,
1) is easy to show: Start Rp2Designer, i use 2.36.0.4, e.g. open "recent files" any rpt, click in the form the minimize button in the caption, and:
Problemsignatur:
Problemereignisname: CLR20r3
Problemsignatur 01: ReportPro2.exe
Problemsignatur 02: 2.36.0.4
Problemsignatur 03: 5f6865ab
Problemsignatur 04: ReportPro2.Runtime
Problemsignatur 05: 2.36.0.4
Problemsignatur 06: 5f6865a4
Problemsignatur 07: 34e
Problemsignatur 08: c8
Problemsignatur 09: System.AccessViolationException
Betriebsystemversion: 6.3.9600.2.0.0.256.103
Gebietsschema-ID: 1031
Zusatzinformation 1: 3931
Zusatzinformation 2: 39318975b0826d60fbcc811b5674ab1a
Zusatzinformation 3: c819
Zusatzinformation 4: c8193034f71ec652fa0054bf97b4896c
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
Heinrich
Posts: 33
Joined: Wed Feb 10, 2016 4:44 pm

Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Post by Heinrich »

Hallo Karl
Vielen Dank für den Test und die Präzisierung des Fehlers.
Da bin ich ja beruhigt, dass der Fehler nicht nur bei mir auftritt.

Grüsse Heinrich
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Post by Chris »

Thanks guys, now I understand and can confirm the problem! Should be fixed soon, will post an update here.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Post by ic2 »

I see there's also a newer ReportPro for VO (2.33 while I use 2.31), changes are all related to rotated text.

Which makes me wonder of this version fixes the following problem, and if not, if it can be fixed in the next version:

When I double click a .rpt file, (I have indicated in Windows that I want to open it with C:rp231sp4Rp2_32.EXE) ReportPro shows the splash screen, and that's it. The splash screen eventually disappears but the double clicked report does not open.

Would be great if that would work.

Dick
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Post by Chris »

Hi Heinrich,

The problem with minimizing windows is fixed now. Since you already have the code, you can change line 357 of ReportPro2, Runtime/Report/RpReportDesigner.prg

from

Code: Select all

SendMessage(oEvent:hWnd,WM_ICONERASEBKGND,DWORD(sPaint:hDC),0)
to

Code: Select all

SendMessage(oEvent:hWnd,WM_ICONERASEBKGND,DWORD(_CAST, sPaint:hDC),0)
(add the _CAST)

Regarding the QueryClose, looking at the QueryClose method defined in the rpShellWindow class itself, it is defined as:

Code: Select all

        METHOD QueryClose (oQCE) 
            
            LOCAL cSetting AS STRING	
            
            IF SELF:lWarnOnExit
                cSetting:=Upper(AllTrim(SELF:oIniFileSpec:GetString("Environment", "WarnOnExit")))
                IF cSetting=="TRUE" .or. cSetting=="ON"
                    IF !YesNo(SELF, RpLangString(IDS_WARN_CAPTION), RpLangString(IDS_WARN_MESSAGE))
                        RETURN FALSE
                    ENDIF
                ENDIF
                SELF:lWarnOnExit := FALSE
            ENDIF
            
            RETURN TRUE
We could change the code to not require this check for SELF:lWarnOnExit, but I think it is probably safer (to avoid breaking someone else's code) that you just modify your code, so it follows the same pattern, something like:

Code: Select all

METHOD QueryClose(oEvent)
	LOCAL lEnde	:= TRUE AS LOGIC
	IF SELF:lWarnOnExit
		lEnde := MessageBox.Show( "Wollen sie das Programm beenden?", "Programm Ende", MessageBoxButtons.YesNo, MessageBoxIcon.Question ) == DialogResult.Yes
		IF lEnde
			SELF:lWarnOnExit := FALSE
		END IF
	END IF
RETURN lEnde

Dick, I did a quick test and RP2 seems to correctly parse the command line and open files that you specify. Please try opening a command prompt, navigate to the folder where the rp2 exe is located and type

Code: Select all

Rp2_32.EXE C:...myreport.RPT
specifying the path to your rpt file, does it work this way?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
Heinrich
Posts: 33
Joined: Wed Feb 10, 2016 4:44 pm

Report Pro 2: Laufzeitfehler wenn Reportfenster minimiert wird

Post by Heinrich »

Good morning Chris

Thank you very much for your super fast help.
Both problems are solved.

Best regards Heinrich
Post Reply