Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Anonymous

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by Anonymous »

Hi. I'm having a problem with SOME reports created in ReportPro 2.17. SOME start with an error saying cannot find "whatever.cdx" despite the fact that there is no possible way that index can be open anywhere else. Any clues at all please? If I click OK, the error goes away and thew report works fine...



Jeff
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by wriedmann »

Hi Jeff,

are you using the Vulcan runtime or the X# runtime?

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
BiggyRat

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by BiggyRat »

VO runtime.
FFF
Posts: 1521
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by FFF »

Jeff,
you write the error is "cannot find" - so it shouldn't matter, whether the cdx is already in use.

Maybe it's related with my open ticket from last year <g>:
Doubleclicking a rpt, it opens the designer, but if the datapath in such a rpt is not correct (e.g. accessing on another machine), RP2 complains and let you select the data.dbf, but immediately complains again about missing cdx, because it looks for the cdx in the old folderpath, instead of the new one - and there's no possibility to select the path for the index.
Karl
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
Jamal
Posts: 314
Joined: Mon Jul 03, 2017 7:02 pm

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by Jamal »

One cause: If your CDX key expression contains user defined functions, RP does NOT know about them and thus the error.
However, just ignore it.
BiggyRat

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by BiggyRat »

Hi Karl and Jamal, I'm not OVERLY concerned by it, but I'm worried the end users will be...


Jeff
Jamal
Posts: 314
Joined: Mon Jul 03, 2017 7:02 pm

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by Jamal »

Well, should we assume you did not write any code to open the report yet?

If not, see oReport:SetReportStringAttribute( ) in the RP docs. This is from RP 3, but it should be the same in RP 2.x if I recall. It has attribute values for dbf path, index driver, table, index file, tag, work_area. If you set those properly, the report will open fine.
BiggyRat

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by BiggyRat »

Well as usual I've looked everywhere for SetReportStringAttribute but it doesn't appear to be in v2.x even Google searches return only results for RP 3.x

Any other ideas anyone?

This is an example that I'm trying at the moment:

METHOD PushButton10( ) CLASS MainMenu
Local oReport as RpReport
LOCAL aDBS[0] as ARRAY
Local CsTR as string
AAdd(aDBS,{"details.dbf","Job Details Table","DBFCDX",FALSE})
AAdd(aDBS,{"client.dbf","Client Table","DBFCDX",FALSE})
CsTR := WorkDir() + "BMInvoice.rpt"
oReport := RpReport{self, aDBS}
oReport:LoadRpt("BMInvoice.RPT")
RETURN nil

That's the entire thing. I just want to open my RPT file in the Designer, but it won't get past the "Cannot Open Client.CDX" Attsached is the actual report causing me the grief. The whole idea is, this Report - BMInvoice is going to be used as a template so the end user can modify their invoice to suit themselves (in much the same way as MYOB does)
Attachments
BMInvoice.zip
(2.28 KiB) Downloaded 21 times
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by robert »

Jeff,
Your report uses:
- C:CAVO28BINDETAILS.DBF with Alias Details
- DETAILS.CDX (note no path specified, so should be opened in the same folder as the DBF
- C:CAVO28BINCLIENT.DBF with alias Client
- C:CAVO28BINCLIENT.CDX
The relation between the two tables is Client.Clcode = Details.Clcode
To override the file names at runtime simply copy all the files to one folder and pass that foldername in the cDataPath parameter or pass the aDBFSwap array and specify details per file:

Code: Select all

oReport := RpReport{oOwner, cFilename, [cDatapath], [aDbfSwap]}
aDbfSwap Allows you to swap out the tables used in the report. While this parameter applies primarily to RDD tables, it can also be used to substitute tables in a SQL query.
Any value of the array that you do not wish to change should be specified as NIL. If you specify NULL_STRING, the value will be changed to the empty string value.
The format of the array is:

{{RPAlias, Table File, Index File, Index Tag, RDD, RDDAlias}, {...}, ...}

RPAlias The alias which ReportPro has assigned to the table. This character value can be found in the Setup Sections dialog. This is the key used to designate which table in the data set is being replaced so it must exactly match the ReportPro alias.

Table File The complete path and file name of the substituted table.
Index File The index file to use in place of the index filename specified in the Setup Sections dialog.
Index Tag The index tag used in conjunction with the Index File specified above. If the Index File is specified, you must specify a Tag for DBFCDX and DBFMDX RDDs.
RDD The RDD to use with this table.
RDDAlias When specified, this element forces ReportPro to use an already open DBF table instead of opening the one specified in the report. This element can be the alias name, the work area number or the DBServer of the already open table.

In your case the RpAlias is "Details" for the first table and "Client " for the second table.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
BiggyRat

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by BiggyRat »

Thanks Robert, that was VERY informative, and clarified A LOT. Thanks very much. However, I'm now getting several different areas. In RP 2.30a creating the Report, it now says it can't find Client.CDX or Details.cdx, though BOTH are in the same folder as the report. Also, when trying to set the Order, I get a message saying "The Index file is not valid for this table" the index file is ALSO in the same folder as the report and the database. I've attached the latest version of the report.

Any ideas please?
Attachments
BMInvoice.zip
(2.29 KiB) Downloaded 21 times
Post Reply