If what you're looking is to print a report, here's one way to do it:

Go into Crystal Reports and create a report (.rpt file).

You can print the report by calling function PePrintReport from
Crpe32.dll as such:


> include "mapbasic.def"
>
> Declare Function PEPrintReport Lib "CRPE32.DLL" (ByVal reportFilePath As String, 
>ByVal toPrint As Integer, ByVal toWindow As Integer, ByVal title As String, ByVal 
>leftLocation As Integer, ByVal topLocation As Integer, ByVal windowWidth As Integer, 
>ByVal windowHeight As Integer, ByVal Style As float, ByVal parentWindow As Integer) 
>As Integer
> Declare Function PEOpenEngine Lib "CRPE32.DLL" () As Integer
> Declare Sub PECloseEngine Lib "CRPE32.DLL" ()
>
> declare sub main()
>
> sub main()
> dim ret as integer
> ret = PEOpenEngine()
> Ret = PEPrintReport("c:\YourDir\YourReport.rpt", 1, 0, "", 0, 0, 0, 0, 0, 0)
> call PECloseEngine()
> end sub'main
>

Make sure that the databases the report expects to print exist and they
are not in use by other applications.  Also be aware that crpe32.dll has
Crystal report .dll dependancies that you need to be aware of for
installation purposes.  If these dependancies are not installed, a call
to peprintreport fails and nothing prints.

I have had problems accessing the databases associated with a report
after it prints.  In the past, I terminated the application which called
peprintreport but another approach would be to use windows API to see if
a crystal reports printing process is still in memory and if so
terminate it.

Hope it helps,

Carol Sheehan



----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to