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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

We have multiple subreports with one parameter hardcoded for each one

Status
Not open for further replies.

ericmazz

Programmer
Aug 17, 2000
3
US
we have multiple subreports that hit the database thru
asp and coldfusion,our parameter known as a datapoint is different and hard coded for each sub, is there anyway around this??? [sig][/sig]
 
Can you write more details about your problem? It is not clear from your question! [sig]<p>Ossama Gharib<br><a href=mailto:eek:gharib@link.com.eg>ogharib@link.com.eg</a><br><a href= to Link Development</a><br>[/sig]
 
We have a container report with multiple subreports inside. There are 10 parameters that we need passed into the container. The datapoint is the parameter that is used to plot each of the charts. The datapoint is hardcoded into each of the charts. We are having a problem passing those 10 in. We need the asp code that will allow us to pass those 10 into a stored procedure and distributed down through each of the subs. The charts done in CR8 are all down correctly, all we need is the code....

Please help [sig][/sig]
 
Here is the ASP code that lets you pass parameters to you report:

Set Session(&quot;ParamCollection&quot;) = Session(&quot;oRpt&quot;).Parameterfields

Set Param1 = Session(&quot;ParamCollection&quot;).Item(1)
Call Param1.SetCurrentValue (CStr(FromDate), 12)
Set Param2 = Session(&quot;ParamCollection&quot;).Item(2)
Call Param4.SetCurrentValue (CDbl(StoreId), 7)


NOTE: The first parameter to the report is Session(&quot;ParamCollection&quot;).Item(1). For SetCurrentValue, to pass a parameter of type String (in SCR)), use CStr() to cast your string and use the second parameter as 12. For a parameter of type Number (in SCR), use CDbl() to cast your number and use the second parameter as 7. [sig]<p>Ossama Gharib<br><a href=mailto:eek:gharib@link.com.eg>ogharib@link.com.eg</a><br><a href= to Link Development</a><br>[/sig]
 
Ok here is what i have for my sub report... it works 100% correctly but the thing is that when we made the subreport we made the report, in Report Designer, with a datapoint_id (which is Param(9)) with a default vale of lets say &quot;88&quot; how do i grab the default value from the subreport??

i looked throught the help files and the closest thing i could find was:

'response.write subparams.item(9).getnthcurrentvalue
or
'response.write subparams.item(9).value

And this &quot;should&quot; grab the default value of item(9).






'==================================================================
' WORKING WITH SETLOGONINFO (SUBREPORT) #1
'==================================================================

'open the subreport
Set CRSubreports = session(&quot;oRpt&quot;).OpenSubreport(&quot;rpt_nt_proc_pct_proc_tm.rpt&quot;)
' The Sample subreport in this example has 3 tables, each table must be
' logged onto using the SetLogOnInfo method.
'Set Subreport logon parameters for each table in the report.

set crtablesub = CRSubreports.Database.Tables.Item(1)
crtablesub.SetLogonInfo &quot;yakko&quot;, &quot;edba&quot;, &quot;sa&quot;, &quot;&quot;
set subparams= crsubreports.parameterfields

response.write crtablesub.testconnectivity

Set ThisParam = subparams.item(1)
Set ThisParam2 = subparams.item(2)
Set ThisParam3 = subparams.item(3)
Set ThisParam4 = subparams.item(4)
Set ThisParam5 = subparams.item(5)
Set ThisParam6 = subparams.item(6)
Set ThisParam7 = subparams.item(7)
Set ThisParam8 = subparams.item(8)
Set ThisParam9 = subparams.item(9)
Set ThisParam10 = subparams.item(10)
Set ThisParam11 = subparams.item(11)


'response.write subparams.item(9).getnthcurrentvalue
'response.write subparams.item(9).value

NewParamValue = &quot;3&quot;
NewParamValue2 = &quot;2004&quot;
NewParamValue3 = &quot;1&quot;
NewParamValue4 = &quot;yakko&quot;
NewParamValue5 = &quot;edba&quot;
NewParamValue6 = &quot;pmi&quot;
NewParamValue7 = &quot;03/21/2000&quot;
NewParamValue8 = &quot;03/30/2000&quot;
NewParamValue9 = &quot;85&quot; <------ this should be the default value
NewParamValue10 = &quot;0&quot;
NewParamValue11 = &quot;0&quot;



ThisParam.SetCurrentValue cint(NewParamValue), 7
ThisParam2.SetCurrentValue cint(NewParamValue2), 7
ThisParam3.SetCurrentValue cint(NewParamValue3), 7
ThisParam4.SetCurrentValue cstr(NewParamValue4), 12
ThisParam5.SetCurrentValue cstr(NewParamValue5), 12
ThisParam6.SetCurrentValue cstr(NewParamValue6), 12
ThisParam7.SetCurrentValue (CDate(#2000/03/23#)), 16
ThisParam8.SetCurrentValue (CDate(#2000/03/30#)), 16
ThisParam9.SetCurrentValue cint(NewParamValue9), 7
ThisParam10.SetCurrentValue cint(NewParamValue10), 7
ThisParam11.SetCurrentValue cstr(NewParamValue11), 12





[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top