Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reporting with Crystal Reports 7
Message
From
01/11/1999 23:00:56
 
 
To
26/10/1999 09:47:41
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00281461
Message ID:
00285274
Views:
20
>>Hi,
>>
>>I have just purchased Crystal Reports 7.0 because I need to include in my application reports with .RTF or .DOC format in order to attach these to emails. I do not have any previous experience with this software, but according to some messages received in this forum, CR is right for the job.
>>
>>For those of you with experience using CR, which would be the path to follow (in general terms) to generate a report with any of the above formats and incorporate it to my application ?
>
>
You should first create an .RPT (say myTest.RPT) with some table - (say myTable in "c:\myCR_RPT_Files\" ). Then this code might help you as a starter :
>
Select * from myTable where Something into cursor myCursor
>_CRReport("myCursor","c:\myCR_RPT_Files\", "myTest.RPT", "myTable")
>
>Function _CRReport
>  Lparameters tcCursorName, tcPath, tcRPTName, tcTableName
>
>  lcAlias = alias()
>  Select (tcCursorName)
>  lcTemp = sys(2015)
>  Copy to (tcPath+lcTemp) type fox2x
>  oCrystal=CreateObject("Crystal.CRPE.Application")
>  #Define WS_MAXIMIZE  29949952
>  Declare integer GetForegroundWindow in WIN32API
>  Declare short IsWindow in WIN32API integer
>
>
>  oRpt = oCrystal.OpenReport(tcRPTName)
>  With oRpt
>    With .Database.Tables(tcTableName)
>      .Location = tcPath+lcTemp+".dbf"
>    Endwith
>    With .PrintWindowOptions
>      .CanDrillDown = .t.
>      .HasCancelButton = .t.
>      .HasCloseButton = .t.
>      .HasExportButton = .t.
>      .HasGroupTree = .t.
>      .HasNavigationControls = .t.
>      .HasPrintButton = .t.
>      .HasPrintSetupButton =.t.
>      .HasProgressControls  =.t.
>      .HasRefreshButton  =.f.
>      .HasSearchButton  =.t.
>      .HasZoomControl  =.t.
>    Endwith
>    .preview ("Report Preview "+"by Cet",,,,,WS_MAXIMIZE,0)
>  Endwith
>  lnHwndActiveX = GetForegroundWindow()	&& Save window handle
>  Do while IsWindow(lnHwndActiveX) # 0  && Wait while Activex Alive
>  Enddo
>  Clear dlls
>
>  Erase (tcPath+lcTemp+".*")
>  If !empty(lcAlias) and used(lcAlias)
>    Select (lcAlias)
>  Endif
Cetin

Hi Cetin & Antonio:

PMFJI: FYI - Just got the Nov. 1999 issue of FoxTalk and the cover article is how to integrate Crystal Reports 7 with VFP. Just in time for me to get into it in our VFP environment. Between the FoxTalk article and your sample code above, I should be well on my way.

Thanx.

Rob
Previous
Reply
Map
View

Click here to load this message in the networking platform