Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameters from web

Status
Not open for further replies.

msnreddy

Programmer
May 31, 2003
8
US
Hi,
i have a report which accepts one parameter,
when i browse the report it is simply asking for a parameter value , insted of this i need to provide set of values and user can select a value for the parameter from the list.
how can i do this??
can any body help me ....

msnreddy
 
Hi
in your parameter setting you can have default values added and also the description
you can have your parameter prompt for the value or the description that the user can pick to run the report.

hope this helps

pgtek
 
Thanks pgtek,
i have added default values for the parameter,
when i run the report from crystal reports , it is allowing me to select value from the drop down list,
but when i run it from browser it is showing only text box insted of drop down

Madhu
 
In this example the report is seen as having 4 main report parameters and 2 subreport parameters.

Note: Subreport-linking parameters do not need to be set with version 8 and 8.5.

set ReportDatabase = Session("oRpt").Database

'Set the Table object and logon (1 table only)
set crdatabasetables = ReportDatabase.Tables
set crtable = crdatabasetables.Item(1)
crtable.SetLogonInfo "ODBCDSNname", "", cstr(userid), cstr(password)

'Create subreport database object, get table(s), login
set CRSubreports = session("oRpt").OpenSubReport("testsub.rpt")
set ReportDatabase2 = CRSubreports.Database
Set crdatabasetables2 = ReportDatabase2.tables
Set CRtable2 = crdatabasetables2.Item(1)
crtable2.SetLogonInfo "ODBCDSNname", "", cstr(userid), cstr(password)

'Get handles to parameters in main report (there are 2)
set Session("ParamCollection") = Session("oRpt").Parameterfields
Set ThisParam1 = Session("ParamCollection").item(1)
Set ThisParam2 = Session("ParamCollection").item(2)

'Set values for the parameters
ThisParam1.SetCurrentValue cstr("paramvalue1"),12
ThisParam2.SetCurrentValue cstr("paramvalue2"),12

'Get handles to parameters in SUB report (there are 2)
set Session("SubRptParamCollection") = CRSubreports.Parameterfields
Set ThisParam1 = Session("SubRptParamCollection").item(1)
Set ThisParam2 = Session("SubRptParamCollection").item(2)

'Set values for the parameters (these were previously set in the main report.
ThisParam1.SetCurrentValue cstr("paramvalue4"),12
ThisParam2.SetCurrentValue cstr("paramvalue3"),12

For more sample ASP applications to use as templates for your Crystal Reports web applications please download the file aspxmps8.exe (for version 8.0) or aspxmps85.exe (for version 8.5) from our support site at:


cheer
pgtek
 
Dear pgtek ,
i am sorry i did't mention that,
i am not invoking report thru asp page ,
but running directly by clicking on .rpt file
madhu
 
Ok

on you window in the parameter section
you can inport a pick list.
Create a txt file in note pad

values description
1 first choice
2 second choice

then save it and go to your parameter window and click on set default and there you will be able to import your pick list

hope this helps

pgtek
 
i did adding default values by selecting table
and when i preview the report from crystal reports tool
it is comming properly. the problem is only when i view it from browser

madhu
 
First of all, I believe it depends on what version of Crystal you are using. For example, in Crystal 8.5, when you create a parameter field, you set the name and type of the parameter. In 8.5 there is also a "Set Default Values" button which will allow you to select values from a DB table, or create values that your report interprets appropriately. Hope that helps.
 
Looks like you are using the Web Component Server. How do you set the default values, by selecting "Browse Table/Browse Field/Import Pick List" options or by entering values manualy? I would try typing in the values and re-running the report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top