index | search | no replies | posting guidelines | help login | register
Index » Products » ASP Report Wizard v2
search this forum:
:: Using Stored Procedures with parameters :: (2)Post a New Message | Post a Reply
Feb 1 2008, 12:16 AM
 Using Stored Procedures with parametersPost a Reply
 katjas

View this author's profile Send this author a private message

since: Jan 31, 2008
from: Cape Town, South Africa

Please advise how I can do the following using ASP Report Wizard:

I have a large number of stored procedures that require the user to enter/select certain parameters at run time (which I need to be able to define, and which differ for each stored procedure). For example, a given stored procedure may require the user to select From Date and To Date, Company etc. I then need to programmatically combine these into a string parameter that is passed to the stored procedure.  The user should then be able to use the report wizard to manipulate the output data into the format he requires.

I think the best way is to use my existing form to get the parameter values from the user and then pass the parameter, together with the name of the associated stored procedure to the report wizard, which should then operate on these. So in this case I would be skipping the step where the user gets to choose which view/table/stored procedure he wants to use to build the report.

Advice will be greatly appreciated.

Feb 5 2008, 2:21 PM
 Re: Using Stored Procedures with parametersPost a Reply
 ghost

View this author's profile Send this author a private message Visit author's homepage

from: Washington, DC

List your stored procedures and their parameters exclusively as shown in the sample code below:
objWiz.UseProcedures = "Procedure1,@Param1='MyValue1',@Param2='MyValue2'|Procedure2,@P1='V1'"

e.g.
bjWiz.UseProcedures = "GetStudents,@LastName='Johnson',@Age=12|GetClasses,SessionDate='" & FormatDatetime(Now,2) & "'"


Note that, if you specify the parameter value as above, the user will not be requested to enter the parameter value. On the other hand, if you wanted the user to enter a parameter value, put a question sign (?) in front of the parameter as shown below:

objWiz.UseProcedures = "Procedure1,@Param1='?ParameterName1',@Param2='?ParameterName2'|Proc2,@P1=?MyOtherParamerterName'"




-------------------------
Ghost
Pages: (1)   [1]

search this forum: