fbpx
Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1
  • 2

TOPIC: Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 2 months 1 week ago #8465

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 148
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

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 2 months 1 week ago #8466

  wriedmann's Avatar wriedmann Away Posts: 1573
Hi Jeff,

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

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 2 months 1 week ago #8467

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 148
VO runtime.

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 2 months 1 week ago #8468

  FFF's Avatar FFF Away Posts: 577
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

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 2 months 1 week ago #8472

  Jamal's Avatar Jamal Away Posts: 124
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.

Please Log in or Create an account to join the conversation.

Last edit: by Jamal.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 2 months 1 week ago #8473

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 148
Hi Karl and Jamal, I'm not OVERLY concerned by it, but I'm worried the end users will be...


Jeff

Please Log in or Create an account to join the conversation.

Last edit: by BiggyRat.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 2 months 1 week ago #8475

  Jamal's Avatar Jamal Away Posts: 124
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.

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 2 months 6 days ago #8523

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 148
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:

Please Log in or Create an account to join the conversation.

Last edit: by BiggyRat.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 2 months 6 days ago #8524

  robert's Avatar robert Offline Posts: 1004
Jeff,
Your report uses:
- C:\CAVO28\BIN\DETAILS.DBF with Alias Details
- DETAILS.CDX (note no path specified, so should be opened in the same folder as the DBF
- C:\CAVO28\BIN\CLIENT.DBF with alias Client
- C:\CAVO28\BIN\CLIENT.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:
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
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8774

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 148
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:

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8776

  lumberjack's Avatar lumberjack Offline Posts: 465
Hi Jeff,

BiggyRat wrote: it now says it can't find Client.CDX or Details.cdx, though BOTH are in the same folder as the report. Any ideas please?

I have never used ReportPro in "designer" mode, only for hardnoded reports. I see your .RPT contains "C:\CAVO28\Bin\<filename>.DBF / .CDX
Are you sure that is where the .DBF/CDX files are located?
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8777

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 148
Yes Johan, absolutely positive...
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by BiggyRat.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8795

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 148
Here is my index re-indexing code. Is there anything in here that's wrong perhaps? I've left all my previous attempts visible to show my working out...

METHOD OptionsReindex CLASS MainMenu

LOCAL oServer as DBServer

RddSetDefault("DBFCDX")
self:Pointer := Pointer{ POINTERHOURGLASS }

SetExclusive( true )

oServer := DbServer{"Client"}
oServer:PACK()
oServer:GoTop()
/* oServer:CreateOrder("CLCode", "Client","CLCode",,.T.)
oServer:CreateOrder("CLName", "Client", "ClName")
oServer:CreateOrder("ClState", "Client", "ClState")
oServer:CreateOrder("CLCodeName", "Client", "AllTrim(CLIENT->ClCode) + Space(1) + Alltrim(CLIENT->ClName)" )
oServer:CreateOrder("CLPcode", "Client", "ClPCode") */
oServer:Reindex()

DbSetIndex("client")
?? DbReindex() <====== returns true


oServer:CLOSE()

oServer := DbServer{"Details"}
oServer:PACK()
oServer:GoTop()
/* oServer:CreateOrder("CLCode", "Details", "CLCode")
oServer:CreateOrder("CLCodeName", "Details", "AllTrim(DETAILS->CLCODE) + Space(1) + AllTrim(DETAILS->CLNAME)" )
oServer:CreateOrder("JobDate", "Details", "JobDate")
oServer:CreateOrder("JobFin", "Details", "JobFin")
oServer:CreateOrder("JobNumber", "Details", "JobNumber")
oServer:CreateOrder("PONumber", "Details", "PONumber",, .T.)
oServer:CreateOrder("Subby", "Details", "Subby",, .T.)
oServer:CreateOrder("Rego", "Details", "Rego")
oServer:CreateOrder("Invoiced", "Details", "Invoiced")
oServer:CreateOrder("InvFile", "Details", "InvFile") */
oServer:Reindex()
DbSetIndex("Details")
?? DbReindex() <======= returns true
oServer:CLOSE()

SetExclusive(FALSE)
self:Pointer := Pointer{ POINTERARROW }
self:Show()

return self

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8796

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 148
OK I worked it out. These two lines are causing it, but WHY?

oServer:CreateOrder("CLCodeName", "Client", "AllTrim(CLIENT->ClCode) + Space(1) + Alltrim(CLIENT->ClName)" )

AND

oServer:CreateOrder("CLCodeName", "Details", "AllTrim(DETAILS->CLCODE) + Space(1) + AllTrim(DETAILS->CLNAME)" )


As expressions they test OK, QQout say they create ok, yet it is these two lines (one in each index of course) stopping the report from opening. What have I done wrong please?

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8797

  lumberjack's Avatar lumberjack Offline Posts: 465
Hi Jeff,

BiggyRat wrote: OK I worked it out. These two lines are causing it, but WHY?
oServer:CreateOrder("CLCodeName", "Client", "AllTrim(CLIENT->ClCode) + Space(1) + Alltrim(CLIENT->ClName)" )
AND
oServer:CreateOrder("CLCodeName", "Details", "AllTrim(DETAILS->CLCODE) + Space(1) + AllTrim(DETAILS->CLNAME)" )
As expressions they test OK, QQout say they create ok, yet it is these two lines (one in each index of course) stopping the report from opening. What have I done wrong please?

Think you just need to drop the "CLIENT->" and "DETAILS->" from your expressions. Rather use "FIELD->" or "_FIELD->", sorry have not done DBF in ages so you need to check those two out.
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8798

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 148
Hmmm OK, thank you very much Johan.

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8799

  lumberjack's Avatar lumberjack Offline Posts: 465

BiggyRat wrote: Hmmm OK, thank you very much Johan.

Hi Jeff,
Further to my previous response, remember you cannot guarantee that your DBF will always be referenced/aliased as "Client", your index expressions are hard-coded to a specific alias. Let us know if that solves the issue.
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8800

  robert's Avatar robert Offline Posts: 1004
Johan,
You are right.
ReportPro opens the workareas with aliases that look like _RP1, _RP2 etc.

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8803

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 148
OK, thank you Robert and Johan,that was something I wasn't aware of with the Aliases in ReportPro. I will certainly keep that in mind. In the meantime, yes, your solution Johan seems to have done the trick. The report now opens every time without error. Thanks again.

Please Log in or Create an account to join the conversation.

Cannot Open SomeIndex.CDX when starting ReportPro 2.17 1 month 4 weeks ago #8810

  wriedmann's Avatar wriedmann Away Posts: 1573
Hi Jeff,

AFAIK CDX indices cannot have variable length expressions. If you are using AllTrim(), you need to pad them to a fixed lenght.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2