ReportPro / Graph Wizard

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ecos
Posts: 147
Joined: Tue Nov 10, 2015 6:49 am
Location: Germany

ReportPro / Graph Wizard

Post by ecos »

Hi Chris,

We are experiencing a very frustrating issue with Report Pro.
Unfortunately, the Graph Wizard for creating embedded charts in a report is not working at all.
Reports created with VO that include a chart analysis generate a report error (Invalid expression for chart column).
This seems to be related to the defined Datasource.

When the Graph Wizard is launched in the designer, the tabs for the settings are located in the upper-left corner of the screen and not on the Wizard dialog or the TabControl.

In addition, after running the Wizard, we experience uncontrolled crashes, which I still need to analyze in more detail.

I know this is a very unpopular topic, but many of our customers are complaining about reports not working after switching from VO to x#.
I’ve already looked at the ReportPro source code, but unfortunately, I’m a bit overwhelmed by it.

Can you give me a tip on what I can change?

TIA
Karl
Attachments
Screenshot 1.png
Screenshot 2.png
Screenshot 2.png (12.3 KiB) Viewed 281 times
ecos
Posts: 147
Joined: Tue Nov 10, 2015 6:49 am
Location: Germany

Re: ReportPro / Graph Wizard

Post by ecos »

Chris,
This seems to solve the wizard-problem:

Code: Select all

METHOD PostInit(oParent,uExtra)	// class rpGWDialog

SELF:Caption := rpLangString(IDS_GW_GRAPHWIZARD)

LOCAL n AS DWORD
FOR n := 1 UPTO SELF:oDCTabControl:TabCount
	VAR oPage := SELF:oDCTabControl:GetPage(n)
	SetParent(oPage:Handle(0),SELF:oDCTabControl:Handle(0))
NEXT

RETURN NIL
Do you agree ?
I will further investigate the crashes and why old reports are not working anymore...

Karl
ecos
Posts: 147
Joined: Tue Nov 10, 2015 6:49 am
Location: Germany

Re: ReportPro / Graph Wizard

Post by ecos »

Report Error results from this bug:

Code: Select all

METHOD InitExpressions(oSection AS rpBaseSection,nState:=0 AS LONGINT) AS LOGIC	// class rpGraph

   if self:oSection==null_object
         SetReportProState(IDL_STATE_VAL_GRAPH)			// init the state for error msgs
			FOREACH oCol AS rpGraphColumn IN SELF:aCols
				oCol:InitExpressions(oSection)
			NEXT
		    SELF:oAxisX:InitExpressions(oSection)
   ELSE
		    SELF:oSection:Connect2Source(NULL_OBJECT,"","",NIL,NIL)
		    SELF:oSection:PrepareData(TRUE)
		    SELF:oSection:InitExpressions()

		    SetReportProState(IDL_STATE_VAL_GRAPH)			// init the state for error msgs
			FOREACH oCol AS rpGraphColumn IN SELF:aCols
// BUG:
//				oCol:InitExpressions(oSection)
// correct:
				oCol:InitExpressions(SELF:oSection)
			NEXT
		    SELF:oAxisX:InitExpressions(SELF:oSection)
   ENDIF
   SELF:Zap()												// get some sample data...
   SELF:Fetch()
   RETURN TRUE
Now to the crashes...
User avatar
Chris
Posts: 5764
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: ReportPro / Graph Wizard

Post by Chris »

Hi Karl,

Can you please send me a .rpt reproducing the problem, together with its needed support files (dbfs, images etc) so I can debug it here?

Btw, we are currently working on a new reporting engine written from scratch and based on GDI+, which should make it much more easier to add new features, fix problems etc. Also the code will be a lot more straightforward than the one in ReportPro. It will be able to fully read .rpt files and most functionality is already implemented, but unfortunately not graphs yet, those will take some time. But will be there eventually so we will not depend on RP anymore.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ecos
Posts: 147
Joined: Tue Nov 10, 2015 6:49 am
Location: Germany

Re: ReportPro / Graph Wizard

Post by ecos »

Chris,

sorry, I have no .rpt-file. We store reports in memo-fields in a table. The designer is deeply integrated in our application.
Currently I am trying to find the crashes with the help of Claude. If I (we) don't find the reason, I will try to create an example for you.
The crashes happen without error-log after using the wizard and closing the designer, no matter if changes were made or saved.

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

Re: ReportPro / Graph Wizard

Post by Chris »

Hi Karl,

How do you then feed the reports into the report pro engine? You use hand coded reports instead? If you can create a small sample with that, it should be enough to debug the problem.

About the pages in the wizard appearing out of the main window, the root problem is that the pages are defined as PopUp Dialogs, instead of Tab Pages. The best solution is to go to the resource files of those pages (GraphWizard (D).rpGWDatasourceDlg.rc, GraphWizard (D).rpGWColsDlg.rc etc) and change the style from "STYLE WS_POPUP" to "STYLE WS_CHILD". I will update the resources and the window binaries in the official source code and make sure it works well also in the case of making changes in those windows in the designer.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ecos
Posts: 147
Joined: Tue Nov 10, 2015 6:49 am
Location: Germany

Re: ReportPro / Graph Wizard

Post by ecos »

Hi Chris,

we create temp-files before printing / designing reports. These are deleted immediately after ReportPro has read them
I've grabbed one before it was deleted...
If you open the report in designer, edit the graph with the wizard and then close the report (no need to save it), ReportPro crashes...

Karl
Attachments
ReportFiles.zip
(8.37 KiB) Downloaded 8 times
ecos
Posts: 147
Joined: Tue Nov 10, 2015 6:49 am
Location: Germany

Re: ReportPro / Graph Wizard

Post by ecos »

Chris,

the problem is in the destroy-methods of rpGraphAxisX and rpGraphAxisY.
memfree tries to free a pointer which was already freed. This solves the problem for now, but we should use different globals for different axis:

Code: Select all

METHOD Destroy()
#warning todo
FOREACH p AS IntPtr IN SELF:aPszs
	NOP
	// MemFree(p)
NEXT
SELF:aPSZs:Clear()

SELF:gch:Free()

RETURN SELF

I will look into this next week, now most of us have a long weekend in Germany

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

Re: ReportPro / Graph Wizard

Post by Chris »

Hi Karl,

Unfortunately I could not reproduce the problem, possibly because I am missing the file paradb.dbf and the report does not load in full, maybe this affects it somehow.

But good catch on finding the problem, I can also see the issue in this code. In

FUNCTION LLBCallBackXAxisLabel(hAxisX AS DWORD ) AS PSZ CALLBACK (and also in the "Y" version)

this code

IF LL_LabelString != NULL_PTR
MemFree(LL_LabelString)
ENDIF

does not exist in the VO version, apparently it was added more than 10 years ago when RP2 was ported to vulcan. That's definitely wrong and should be removed, since the strings are being freed later.

Also the code in VO does not use a global pointer for holding the allocated string, instead uses a local variable, and I do not see a reason for using a global in X# either. Can you please make the change, use a local instead of a global and see if all still works correctly?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply