I have been doing a lot of reading up on n-tier stuff - User services, Business services, data services etc. My Question is :
It is fine to talk about GUI -> Business Layer/service -> Data Service,and it can be implemneted - but has anybody implemented a regular commercial app where the Reporting also goes thru 'Business Service' ( Which i equate to Bizobjs ) ?
Curious to know !
Prakash R Bhat
prb@giasmd01.vsnl.net.in
Hi Prakash:
<I><FONT COLOR="#663300">I have been doing a lot of reading up on n-tier stuff - User services, Business services, data services etc. My Question is :
It is fine to talk about GUI -> Business Layer/service -> Data Service,and it can be implemneted - but has anybody implemented a regular commercial app where the Reporting also goes thru 'Business Service' ( Which i equate to Bizobjs ) ?
</I>
There is a class library in SAVI Codebook named cSAVIPrt.VCX. It contains one class named SAVIPrintingForm. This class, coupled with the event object can accomplish exactly what you are looking for. Define the required business objects as participant objects of the event. In the execute event method of the event, requery the business objects to obtain the data you require (any amount of pre-processing can be attached here that accepts parameters from users etc.) This, in effect, is how I set up the printing environment ... it is a more dynamic way of reporting that using the Codebook standard. The SAVIPrintingForm accepts the name of the .FRX file and a title to display when printing the report. This form allows the user to preview, print with dialog, print without dialog or print to a file.
Let me know if you have any questions. I believe that you have the version of SAVI Codebook that contains aforementioned .VCX.
Take care,
CTBlankenship
mailto:ctb@savvysolutions.com
Flash Creative Management, Inc. (FLASH)
ctb@flashcreative.com
tomandanna@erols.com
Prakash,
What you're asking seems out of reach with the present state of VFP
report writer. But we may try to tend to it. Here is what I am doing
right now.
Since VFP reports are not object oriented, I prepare one template report
per project.
In the BeforeOpenTables(), I create the report session environment:
goApp.oReportSessionEnvironment=CREATEOBJECT("cReportSessionEnvironment")
Its purpose is to SET all the fixed settings I'll need with all reports.
Code follows at the end of the message.
In the init(), I do the following:
LOCAL loDataEnvironment
*-- instantiate the Data Environment
*-- this will load all cursors needed for the report.
*-- 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.
loDataEnvironment = CREATEOBJECT("<DataEnvironment>")
RETURN TYPE("loDataEnvironment") == "O"
and in the destroy I release the report session environment object
goApp.oReportSessionEnvironment = .NULL.:
You can make what you want in the init(). By example, if you use a
parameterized view, you could call a form to obtain the view parameters.
After trying out many things, I've found that the most convenient way is
to create a cursor with as many fields as the view parameters, and insert
a blank record. I pass the datasession as a parameter to the model form,
make sure that it shares the same datasession as the report, obtain the
view parameters, save them in the cursor. Once back in the Init() of the
report I can requery the view and proceed with the report.
**************************************************
*-- Class: creportsessionenvironment
(c:cdbk30common30libscenviron.vcx)
*-- ParentClass: cenvironment (c:cdbk30common30libscenviron.vcx)
*-- BaseClass: container
*
#INCLUDE "c:cdbk30common30includeframincl.h"
*
DEFINE CLASS creportsessionenvironment AS cenvironment
lsaveoldsettings = .F.
Name = "creportsessionenvironment"
PROCEDURE set
SET DELETED ON
SET TALK OFF
SET SAFETY ON
SET POINT TO ","
SET SEPARATOR TO "."
SET DATE FRENCH
SET CURRENCY TO "F"
SET CURRENCY RIGHT
SET CENTURY ON
ENDPROC
ENDDEFINE
*
*-- EndDefine: creportsessionenvironment
**************************************************
JosÃ
œ