Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling VFP report wizard with parameters
Message
From
15/12/2002 11:37:13
 
 
To
15/12/2002 10:57:40
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00730782
Message ID:
00733164
Views:
32
>>Just found out you can call the VFP report wizard in AUTOREPORT mode with an object parameter and it creates an FRX on the fly for you in the chosen style, perhaps your own. I have been looking for this for quicker development but did not realize it was under my nose. All you have to do is create a cursor with fields named as you want the columns titled.
>>
>>More generally, all wizards can be called with parameters, and it may be a worthwhile project to document them here.
>>
>That sounds interesting. However, I don't understand "object parameter" in this context. What are you passing - an object, or the name of the cursor?

You actually pass an object whose properties are the parameters. This is the kind of code you need to use. Look at the wizard source for more details.
oParametros = NEWOBJECT('line')
oParametros.AddProperty('cWizTable','')
oParametros.AddProperty('cWizAlias','')
oParametros.AddProperty('lBlankForm',.F.)
oParametros.AddProperty('aWizFields','')
oParametros.AddProperty('cStyleFile','Styles\Style3H.frx')
oParametros.AddProperty('aWizSorts','')
oParametros.AddProperty('lSortAscend',.T.)
oParametros.AddProperty('lTruncate',.F.)
oParametros.AddProperty('cOutFile','rpt'+ALIAS()+'.FRX')
oParametros.AddProperty('nLayout',1)
oParametros.AddProperty('nColumns',1)
oParametros.AddProperty('lLandscape',.T.)
oParametros.AddProperty('nWizAction',GO_MODIFY)
oParametros.AddProperty('cWizTitle',ALIAS())
DO WzReport WITH '','AUTOREPORT',,oParametros
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform