Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: chris preston
  Where is chris preston?
 Kingston
 Jamaica
 chris preston
 To: David Mustakim
  Where is David Mustakim?
 Jakarta
 Indonesia
 David Mustakim
 Tags
Subject: RE: sub totals in a grid
Thread ID: 395127 Message ID: 395418 # Views: 40 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Tuesday, January 14, 2014 7:35:26 PM         
   


> >
> >
> >
> > Is there a manual or a guide as to how to move from this example to a production setup
>
>
> The 'runtime.scx's init event should be self explanatory. Two lines one might consider missing are:
> - replace "SELECT..." with SQLEXEC()
> - play with the last few lines, especially "this.afw_drillgrid1.lUseTotal = ..." value and it will set you free
>
> Of course I am assuming that you do know how to drop .vcx onto forms, right?!
>
> David



Hello David,
I would drag it from the class to the form.....

But I first tried to copy the runtime grid to a testgrid and change the init setting but go an error message. please see below

Fatal error: Exception code=C0000005 @ 14-01-2014 01:29:37 PM. Error log file: C:\Program Files\Microsoft Visual FoxPro 9\vfp9err.log
Called from - form1.afw_drillgrid1.grid_init line 128 {c:\ttmsonline\drill\drillgrid.vct c:\ttmsonline\drill\drillgrid.vct}
Called from - form1.init line 27 {c:\ttmsonline\drill\testgrid1.sct c:\ttmsonline\drill\testgrid1.sct}

The Init file is as follows


*USE (_samples+[northwind\products]) IN 0 ALIAS products
*USE (_samples+[northwind\suppliers]) IN 0 ALIAS suppliers
USE recvsum IN 0 ALIAS recvsum
*SELECT ;
ALLTRIM(suppliers.companyname) AS supplier, ;
products.productid, ;
products.productname, ;
products.quantityperunit, ;
products.unitprice ;
FROM products ;
JOIN suppliers ON suppliers.supplierid = products.supplierid ;
ORDER BY 1,2 ;
INTO CURSOR csrProducts
SELECT brnkey,totinvoice,issuedate,agntname,bal_os FROM recvsum INTO CURSOR crsRecvsum
USE IN recvsum
*USE IN suppliers

this.grid1.RecordSource = "crsRecvsum"
this.grid1.ColumnCount = 5
this.grid1.Refresh()

this.afw_drillgrid1.oGrid = this.grid1
this.afw_drillgrid1.cid = "brnkey"
this.afw_drillgrid1.lUseTotal = .T.
this.afw_drillgrid1.nTotalColumn = 5
this.afw_drillgrid1.Grid_Init()

This Grid function is really great (if i get it to work)

Regards

ENTIRE THREAD

sub totals in a grid Posted by chris preston @ 1/10/2014 1:34:35 PM
RE: sub totals in a grid Posted by Rahul Moudgill @ 1/10/2014 1:47:26 PM
RE: sub totals in a grid Posted by David Mustakim @ 1/10/2014 2:02:36 PM
RE: sub totals in a grid Posted by Rahul Moudgill @ 1/10/2014 3:34:19 PM
RE: sub totals in a grid Posted by chris preston @ 1/10/2014 3:44:01 PM
RE: sub totals in a grid Posted by Rahul Moudgill @ 1/10/2014 3:51:52 PM
RE: sub totals in a grid Posted by chris preston @ 1/10/2014 4:01:00 PM
RE: sub totals in a grid Posted by chris preston @ 1/10/2014 4:19:50 PM
RE: sub totals in a grid Posted by David Mustakim @ 1/10/2014 6:16:08 PM
RE: sub totals in a grid Posted by chris preston @ 1/10/2014 5:44:57 PM
RE: sub totals in a grid Posted by David Mustakim @ 1/10/2014 6:14:53 PM
RE: sub totals in a grid Posted by chris preston @ 1/14/2014 7:35:26 PM