xsharp.eu • ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs
Page 1 of 2

ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs

Posted: Mon Apr 01, 2024 12:58 pm
by Stavros Spanos
There are 2 reports that use DBF files.
DBF files are located to folder C:\Temp\
When previewing and printing the reports via a VO app everything is ok. VO app uses ActiveX ReportPro.Runtime.39.
At X# app we use the ReportPro 3 for X#(3.6.0.4) dlls.

The problems that occur at X# are the below.
Case 1( _Test.rpt)
If having the code line oReport:SetReportStringAttribute( RP_RPT_ATTR_DFLT_DATA_PATH, Workdir() ) the GROUPING for the records is not performed as it should. All the elements of the report sections are defined( table, index ,alias etc ).
If ommitting or having the code line oReport:SetReportStringAttribute( RP_RPT_ATTR_DFLT_DATA_PATH, “C:\Temp\ “), the GROUPING for the records is well performed.

Case 2( _Test1.rpt)
At this case if ommiting the line oReport:SetReportStringAttribute( RP_RPT_ATTR_DFLT_DATA_PATH, Workdir() ) or ommiting the line oReport:SetReportStringAttribute( RP_RPT_ATTR_DFLT_DATA_PATH, “C:\Temp\ “) there is no report at all.

On the other hand if writing the line oReport:SetReportStringAttribute( RP_RPT_ATTR_DFLT_DATA_PATH, Workdir() ) or oReport:SetReportStringAttribute( RP_RPT_ATTR_DFLT_DATA_PATH, “C:\Temp\ “) the report is created but not as expected. Something wrong with the triggered sections.

i cannot upload the X# sample app. it is larger than 2MB

Re: ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs

Posted: Mon Apr 01, 2024 2:03 pm
by Chris
Stavro, remove the RP binaries from the zip and send it again. We will add the dlls manually.

Re: ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs

Posted: Tue Apr 02, 2024 6:50 am
by Stavros Spanos
ok i upload the X# app without the ReportPro Dlls

Re: ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs

Posted: Tue Apr 02, 2024 9:46 am
by Chris
Hi Stavros,

Thanks, got them, you could also remove the X# runtime dlls to make it smaller. WorkDir() returns the "current" directory, which initially is set to the folder where the .exe is run from, so I think it makes sense it doesn't work well when using this folder. Could it be that in the VO version you have placed the dbfs also in the exe folder? Or that you are changing the current dir manually with code (I didn't see something like that in your sample)?

Re: ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs

Posted: Tue Apr 02, 2024 9:56 am
by Stavros Spanos
i set manually all the directories at the code at both apps.

Re: ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs

Posted: Tue Apr 02, 2024 10:12 am
by Chris
Hi Stavros,

Maybe it's an incompatibility on how WorkDir() works in VO and in X#. What command are you using to change the directory?

Re: ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs

Posted: Tue Apr 02, 2024 1:04 pm
by Stavros Spanos

Code: Select all


oReport:LoadReport("C:\Temp\_TEST.RPT")

oReport:SetTableStringAttribute( 1, "Orbtemp", RP_TABLE_ATTR_DRIVER, "DBFCDX" )
oReport:SetTableStringAttribute( 1, "Orbtemp", RP_TABLE_ATTR_TABLE, "C:\Temp\Salestmp.dbf" )
oReport:SetTableStringAttribute( 1, "Orbtemp", RP_TABLE_ATTR_INDEX_FILE, "C:\Temp\Salestmp.CDX" )
oReport:SetTableStringAttribute( 1, "Orbtemp", RP_TABLE_ATTR_INDEX_TAG, "SalesTmp2" )

oReport:SetReportStringAttribute( RP_RPT_ATTR_DFLT_DATA_PATH, WorkDir() )


Re: ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs

Posted: Tue Apr 02, 2024 2:40 pm
by Chris
What I meant is that WorkDir() returns the path from where your app is run, why are you using this function when showing the report? Are the dbf files indeed in this folder in your VO app? Also in the X# version of the app?

Re: ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs

Posted: Wed Apr 03, 2024 6:31 am
by Stavros Spanos
The dbf files are located at C:\Temp not the workdir() folder.
The problem also exists if ommiting this line at case_2

Re: ReportPro 3 for X#(3.6.0.4) Problems with reports using DBFs

Posted: Wed Apr 03, 2024 6:48 am
by Chris
Stavro, since your dbfs are in the c:\temp folder, then why are you setting the default data path for the report to another directory with WorkDir()?