Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal Report - Passing Structures To Print Functions
Message
From
01/07/1999 09:42:43
 
 
To
01/07/1999 09:30:58
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00236412
Message ID:
00236427
Views:
11
>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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform