Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing a report with a table from another directory.
Message
From
21/05/2002 05:33:19
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Title:
Printing a report with a table from another directory.
Miscellaneous
Thread ID:
00659259
Message ID:
00659259
Views:
54
I have big problems with using Crystal Reports with VFP7 using COM. The simpliest things which I try basicly by copy code from Advisor articles does not work...

What I have done to try it out is to create a report which just prints countires. If I have the table in the same directory as the report (or actually the same directory as specified when creating the report) everything works fine, I can even change the table name. But as soon as I try to print the report with a table from another directory I get the following error messeage:

ODBC Error: [Microsoft][ODBC Visual FoxPro Driver]File 'omcountry_rpt_2.dbf' does not exist.

Although it exist.

My code that is working:
oapp = CREATEOBJECT('crystalruntime.application')
oreport = oapp.OpenReport(lcrpt, 1)
oreport.Database.Tables.Item(1).Location = 'omcountry_rpt.dbf'
oreport.ReadRecords()
oreport.SelectPrinter('', GETPRINTER(), '')
oreport.PrintOut()

My code that is NOT working:
oapp = CREATEOBJECT('crystalruntime.application')
oreport = oapp.OpenReport(lcrpt, 1)
oreport.Database.Tables.Item(1).Location = 'e:\temp\omcountry_rpt_2.dbf'
oreport.ReadRecords()

And the strangest thing of all... This code works:
oapp = CREATEOBJECT('crystalruntime.application')
oreport = oapp.OpenReport(lcrpt, 1)
oreport.Database.Tables.Item(1).Location = 'e:\temp\omcountry_rpt.dbf'
oreport.ReadRecords()
oreport.SelectPrinter('', GETPRINTER(), '')
oreport.PrintOut()

The table name is the same as the original, but the file does not exist in that directory and has never done...

So how do I get Crystal Reports to understand that it should pick up a table from another directory?

Thanks in advance!
---( Mårten Törnquist )---
Next
Reply
Map
View

Click here to load this message in the networking platform