Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Passing in SubReport Sproc Parameters using ASP

Reply
Thread Tools

Passing in SubReport Sproc Parameters using ASP

 
 
Aaron
Guest
Posts: n/a
 
      08-14-2003
The following code works fine when previewing a Crystal report using
ASP, EXCEPT when it gets to a report using a SubReport and its
associated parameters. The whole report just comes up blank with this
error message: "The Error Message was: Error detected by database
DLL.from: Crystal Reports ActiveX Designer".

What am I doing wrong in the SubReport section below and how do I
properly pass in sproc params to the subreport? Thanks.

------------------------------------------------------------

<%@ LANGUAGE="VBSCRIPT" %>
<title>Make Report</title>

<%
reportname = "\Reports\" & request("ReportName")
%>

<!-- #include file="AlwaysRequiredSteps.asp" -->

<%

userid = "userid"
Password= "pwd"

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False

set crtable = session("oRpt").Database.Tables.Item(1)
crtable.SetLogonInfo "SERVER", "DB", cstr(userid),cstr(Password)

'================================================= =================
' WORK WITH STORED PROCEDURE PARAMETERS

' - get the database's Stored Procedure Parameters
' Create a variable and point it to the Stored Procedure Parameter
' in the report

set StoredProcParamCollection = Session("oRpt").ParameterFields

' - get the specific Store Procedure Parameter
' Create a variable and point it to the specific stored procedure
' that we want to work on

Set Param1 = StoredProcParamCollection.item(1)
Set Param2 = StoredProcParamCollection.item(2)

' Save the new value for the Stored Procedure in the Store Procedure

Param1.SetCurrentValue cstr((request("Program"))), 12
Param2.SetCurrentValue cstr((request("Client"))), 12

'================================================= =================
''' ** Check for SubReport here
'================================================= =================
if (request("SubReportName"))<>"-1" then

'Open the subreport - This creates a subreport object
Set CRSubreports = session("oRpt").OpenSubreport(cstr((request("SubRe portName"))))

userid = "userid"
Password= "pwd"

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False

' Create Database object
set ReportDatabase2 = CRSubreports.Database

'Database Table collection
Set crdatabasetables2 = ReportDatabase2.tables

set crtable2 = crdatabasetables2.Item(1)
crtable2.SetLogonInfo "SERVER", "DB", cstr(userid),cstr(Password)

'================================================= =================
' WORK WITH STORED PROCEDURE PARAMETERS

' - get the database's Stored Procedure Parameters
' Create a variable and point it to the Stored Procedure Parameter
' in the report

set StoredProcParamCollection = Session("oRpt").ParameterFields

' - get the specific Store Procedure Parameter
' Create a variable and point it to the specific stored procedure
' that we want to work on

Set subParam1 = StoredProcParamCollection.item(1)
Set subParam2 = StoredProcParamCollection.item(2)

subParam1.SetCurrentValue cstr((request("Program"))), 12
subParam2.SetCurrentValue cstr((request("Client"))), 12

end if

%>
<!-- #include file="MoreRequiredSteps.asp" -->
<!-- #include file="SmartViewerActiveX.asp" -->

-----------------------------------------------------------
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple sproc executes 240 times slower when called from asp.net thanwhen called from QA Radu ASP .Net 7 08-28-2009 09:09 PM
TableAdapter using SProc Returning IDentity Elmo Watson ASP .Net 0 07-20-2006 09:57 PM
Updating records using gridview, sqldatasource, and sproc =?Utf-8?B?UA==?= ASP .Net 1 11-30-2004 05:04 AM
Problem using COMPUTE with SPROC on ASP Application =?Utf-8?B?c2tpcmtieQ==?= ASP .Net 1 11-01-2004 12:55 PM
SQL 2k - ASP.NET - SPROC - "Input string was not in a correct format." Chad Micheal Lawson via .NET 247 ASP .Net 4 09-24-2004 04:49 PM



Advertisments