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

This forum is the place to discuss issues related to ReportPro, Xs2Ado, Vo2Ado, bBrowser and other 3rd party products
User avatar
Stavros Spanos
Posts: 115
Joined: Thu Nov 12, 2015 4:59 pm
Location: Greece

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

Post 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
Attachments
ApplicationBBrowser VO.zip
(47.61 KiB) Downloaded 3271 times
User avatar
Chris
Posts: 4856
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post by Chris »

Stavro, remove the RP binaries from the zip and send it again. We will add the dlls manually.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Stavros Spanos
Posts: 115
Joined: Thu Nov 12, 2015 4:59 pm
Location: Greece

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

Post by Stavros Spanos »

ok i upload the X# app without the ReportPro Dlls
Attachments
ApplicationBBrowser X#.zip
(1.59 MiB) Downloaded 88 times
User avatar
Chris
Posts: 4856
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post 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)?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Stavros Spanos
Posts: 115
Joined: Thu Nov 12, 2015 4:59 pm
Location: Greece

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

Post by Stavros Spanos »

i set manually all the directories at the code at both apps.
User avatar
Chris
Posts: 4856
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post 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?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Stavros Spanos
Posts: 115
Joined: Thu Nov 12, 2015 4:59 pm
Location: Greece

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

Post 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() )

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

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

Post 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?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Stavros Spanos
Posts: 115
Joined: Thu Nov 12, 2015 4:59 pm
Location: Greece

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

Post 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
User avatar
Chris
Posts: 4856
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post 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()?
Chris Pyrgas

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