Tuesday, January 06, 2009   
 Search   
 

http://www.foxfirereporting.com
Register  Login  
Forums  
      
 Forums    
SearchForum Home
  Support  Foxfire! Object Model & Customization Support  Tutorial Part 1...
 Tutorial Part 1: Accessing the Object Model
 
 8/16/2007 6:13:38 AM
AndrewM
102 posts
www.aksel.com
5th


Tutorial Part 1: Accessing the Object Model
(this is the first part in a series of tutorials on how to use the Foxfire! 8.0 object model. Feel free to post questions and offer suggestions on how to best use the object model).

Along with its visual redesign, Foxfire! 8.0 also incorporates a new object model to make it easier for developers to access and update key Foxfire! 8.0 elements. When reviewing the source code in Foxfire! 8.0, you will also see that the majority of the code uses the object model instead of relying on additional variables.

There is a object model help file available for download from this site as well. The link is http://www.foxfirereporting.com/ffomhelp.zip.

The starting point of any access to the Object model is accomplished with the ffapplication class.
You can access the object model in two ways:

From within Foxfire!, the variable "loff" is a pointer to the ffapplication instance. If you want to run it on its own, you can use the DLL or issue a SET CLASSLIB TO ("VFOXFIRE") IN "FOXFIRE.APP" and then create the object:

lo = CREATEOBJECT("ffapplication")

lo = createobject("Foxfire.ffapplication")

The ffapplication class has several aspects to it but the two most important are SetLocation and then LoadPreference.

lo.SetLocation("C:\FF80\")

This identifies the location of Foxfire!.

lnResult = lo.LoadPreference("Sample Data Set",UserId,Password)

This loads the desired report set. It will return a numeric message with any value of 0 and above indicating a successful loading.

If the result is a negative number, call ErrorInfo to identify why the report set could not be loaded.

? lo.ErrorInfo(lnResult)

Once loaded, a series of collections are loaded into the ffapplication class.

Requests - a collection of all the requests
Preferences - a collection of all the report sets
Joins - the joins
DataItems - the data items

When working with the collections, you can reference individual items in the following method:

FOR lni = 1 TO lo.requests.count
loReq = lo.requests.items(lni)
? loReq.RequestName
ENDFOR

When accessing the object model from within FoxPro and not using the DLL, you can also reference particular items by passing the value instead of the numeric index.

loItem = lo.DataItems.Items("Cars Make")

In the next tutorial, we will go through the individual pieces of a Request.
  Support  Foxfire! Object Model & Customization Support  Tutorial Part 1...
   
SearchSearch  Forum HomeForum Home     
 Links    
   
  
Downloaded from DNNSkins.com