>I have been working with VFP and Crystal Reports for a couple of months. In that time I have found some of the same issues documented on this site. For those of you interested, I also found a work around for connecting to VFP via ODBC. I have also found a way to make the printouts faster.
>
>Work around for ODBC...
>Rather than connecting to your VFP table via ODBC copy your data to a Foxpro 2.6 format. You can connect to it with Crystal Reports without ODBC. It is faster to copy to a 2.6 structure. COPY TO [Filename] TYPE FOX2X, once you create the structure you can append directly into it in the future.
>
>Make Printouts Faster...
>I started working with the Crystal Report OCX, but found it slow. I have recetly switched to the Crystal Report API (CRPE32.DLL). You can open and send printouts as much as twice as fast as connecting to the OCX.
>
>My Problem...
>When using the Crystal Report API can do almost everthing except pass a structure to a function. The function PEOutputToPrinter requires a PEPrintOptions structure to control things like page range, number of copies, collation, etc. I understand I have to pass the structure as a string but Im not sure about the conversion. The Structure is as follows:
>
>struct PEPrintOptions
> {WORD StructSize;
> unsigned short startPageN,
> stopPageN;
> unsigned short nReportCopiues;
> unsigned short collation;
> chr outputFileName [PE_FILE_PATH_LEN];};
>
You can construct this with a string, since there are no embedded pointers; you'll want to concatenante the values together using the various conversions in the procedure library associated with CLSHEAP:
pePrintOptions = NumToWord( 10 + PE_FILE_PATH_LENGTH) + ;
NumToWord(StartpageN) + ;
NumToWord(StopPageN) +
NumTOWord(NumReportCopies) + ;
NumTOWord(CollationValue) +
PADR(FilePath, PE_FILE_PATH_LEN, CHR(0))
>I have looked at the clshelp.prg file and understand some of the conversions, but I still don't understand the entire process.
>
>Thanks For The Help
>Mark Parker
>MAP Software, Inc.