Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jamie Osborn
  Where is Jamie Osborn?
 Melbourne
 Australia
 Jamie Osborn
 To: Jamie Osborn
  Where is Jamie Osborn?
 Melbourne
 Australia
 Jamie Osborn
 Tags
Subject: RE: user selectable subtotals in report form
Thread ID: 21679 Message ID: 21703 # Views: 18 # Ratings: 0
Version: Visual FoxPro 6 Category: Reports and Printers
Date: Monday, March 31, 2003 1:26:58 AM         
   


> > I need to allow user to select which column they want subtotaled...is there a way to change the grouping expression in report form before report form is called? I have found the records in the report form (objtype = 9 and objcode = 3, in EXPR field) where field name is placed. I suspected I'd have to modifiy those records?
> >
> > Thanks,
> > Al
>
> You could do it that way but why not have one field in your result cursor that you always group on and modify your select statement to use that field.
> eg.
>
> DO CASE
> 	CASE nGroup = 1
> 		lcGroup = "Sex"
> 	CASE nGroup = 2
> 		lcGroup = "Weight"
> 	&& etc. etc.
> ENDCASE
> 
> SELECT Name, ;
>             Address, ;
>             Age, ;
>             Sex, ;
>             Weight ;
> FROM Person ;
> ORDER BY &lcGroup ;
> INTO CURSOR MyResultCursor
> 

> Cheers,
> Jamie
> jamie.osborn@foxite.com

Whoops - should have been :
 SELECT Name, ;
             Address, ;
             Age, ;
             Sex, ;
             Weight, ;
             &lcGroup as MyGroup ;
 FROM Person ;
 ORDER BY &lcGroup ;
 INTO CURSOR MyResultCursor

I got interupted and hit send without thinking !!!!!!

Cheers,
Jamie
jamie.osborn@foxite.com

COMPLETE THREAD

user selectable subtotals in report form Posted by Al Klapperich @ 3/28/2003 8:34:42 PM
RE: user selectable subtotals in report form Posted by Jamie Osborn @ 3/31/2003 1:24:40 AM
RE: user selectable subtotals in report form Posted by Jamie Osborn @ 3/31/2003 1:26:58 AM
RE: user selectable subtotals in report form Posted by Al Klapperich @ 4/1/2003 5:06:29 PM