Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing an object to the report
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00132484
Message ID:
00132671
Views:
11
>I've got an object that has a number of properties that'd I'd to include in a report. I'm wondering if/how I can pass an object reference to the report. Unfortunately, I can't create the object from the report.
>
> My next thought was to create a method that took these properties and made them local variables, then ran the report from that method instead of my Print() method. I might just do this instead, but I kind of prefer having all my print code located only in the Print method.
>
> Ideas?
>
>Thanks,

Paul,

I'm after something similar too. What comes closest to this approach is a great article by Jim Booth in FoxPro Advisor (June or July) but have had no chance to try it yet.

You can create an object from within the report. For example, in my DataEnvironment BeforeOpenTables()
*-- create the report session environment
goApp.oReportSessionEnvironment=CREATEOBJECT("cReportSessionEnvironment")

For now I'm doing most of my business in the dataenviroment Init() and I use a cursor like a cash drawer to pass between the Init() and a form that will accept lots of user criteria.

*-- Because the environment object is local, it will be
*-- destroyed when the object goes out of scope (when the
*-- init() method is exited). Since AutoCloseTables is set
*-- to .F., the cursors will stay open.
#INCLUDE "C:\CDBK30\COMMON30\INCLUDE\FRAMINCL.H"

LOCAL llRetVal, ;
llContinue, ;
lcNomPra, ;
lnRecCnt

PUBLIC gcString

loDataEnvironment = CREATEOBJECT("RepAikiEnvironment")

IF TYPE("loDataEnvironment") # "O"
RETURN .F.
ENDIF

CREATE CURSOR Notices (mMessage M, lKagami1 L, lKagami2 L, dEcheance D, ;
cid1 C(2), cid2 C(2), cid3 C(2), cid4 C(2), ;
cid5 C(2), cid6 C(2), cid7 C(2), cid8 C(2))
INSERT INTO Notices (mMessage) VALUES (REPAIKI_LOC)

llRetVal = DOFORM("AikiForm", SET("DATASESSION"))

IF ! llRetVal && cancel has been selected
RETURN .F.
ENDIF

*-- from here on process the stuff in the cursor to get the view parameters.


José
Previous
Reply
Map
View

Click here to load this message in the networking platform