Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing a report with a table from another directory.
Message
De
21/05/2002 09:32:26
 
 
À
21/05/2002 05:33:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Divers
Thread ID:
00659259
Message ID:
00659321
Vues:
17
Did you "Save data with report"? If so, go to File-Options-Reporting and clear the save data with report option. This may help.

We use code similar to yours daily. The only difference I see is that we stuff the database name in a variable before setting it's location.


>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!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform