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
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by lumberjack »

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:CAVO28Bin<filename>.DBF / .CDX
Are you sure that is where the .DBF/CDX files are located?
______________________
Johan Nel
Boshof, South Africa
BiggyRat

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by BiggyRat »

Yes Johan, absolutely positive...
Attachments
dir.jpg
dir.jpg (200.24 KiB) Viewed 411 times
BiggyRat

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by BiggyRat »

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
BiggyRat

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by BiggyRat »

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?
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by lumberjack »

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
Boshof, South Africa
BiggyRat

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by BiggyRat »

Hmmm OK, thank you very much Johan.
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by lumberjack »

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
Boshof, South Africa
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by robert »

Johan,
You are right.
ReportPro opens the workareas with aliases that look like _RP1, _RP2 etc.

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

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by BiggyRat »

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.
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Cannot Open SomeIndex.CDX when starting ReportPro 2.17

Post by wriedmann »

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
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply