Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I pass VFP objects as parameters to a crystal for
Message
From
10/03/2000 05:47:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
09/03/2000 17:07:47
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00343887
Message ID:
00344083
Views:
26
>I have created a form to run a report that was designed in crystal. I am reporting from a VFP Table. I would like to be able to filter the data on a user defined criteria and then run the report for those results. My problem is allowing the crystal form to report from the particular cursor/table/view


Do filtering on VFP side and pass Crsytal only the SQL result in a fox2x type table :
select * from myTable where SomeField = "SomeValue" into cursor myCursor
=CrystalRep("myCursor","c:\myCrstalReports\myReport.RPT","myTable")

function CrystalRep
lparameters tcCursorName, tcRPTName, tcTableName
lcAlias = alias()
select (tcCursorName)
lcTemp = sys(2015)
Copy to (sys(5)+curdir()+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 = sys(5)+curdir()+lcTemp+".dbf"
  Endwith
  .preview ("Report Preview ",,,,,WS_MAXIMIZE,0)
Endwith
lnHwndActiveX = GetForegroundWindow()	&& Save word window handle
DO while IsWindow(lnHwndActiveX) # 0  && Wait while Activex Alive
ENDDO
Clear dlls
Erase (sys(5)+curdir()+lcTemp+".*")
if !empty(lcAlias) and used(lcAlias)
	select (lcAlias)
endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform