473,394 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Passing in SubReport Sproc Parameters using ASP

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" -->

-----------------------------------------------------------
Jul 19 '05 #1
0 5419

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: mirza i | last post by:
in asp i have this line: ..... Set paramsx = cmdUpdatex.CreateParameter ("@invdate", addate, adParamInput, 50, invdate) cmdUpdatex.Parameters.Append paramsx ... (the invdate value is a...
9
by: Downstreamer | last post by:
Design is as follows: A form for the user to input criteria to be used as the where part of the report's recordsource. This includes a multiselect list box as part of the criteria selection. ...
1
by: a | last post by:
I'm trying to pass an xml file as a variable of type string to an OpenXML stored procedure, but the code below fails at the "sCmd01.ExecuteNonQuery();" line. The SPROC is working fine in Query...
4
by: Chad Micheal Lawson via .NET 247 | last post by:
I'm stumped at this point and I'm tired of trying things so I'mposting in hopes of some guru with a sharp eye. I have anasp.net app running on a local Win XP Pro box. Within the app,I call a SPROC...
0
by: lewindha | last post by:
Hi all I am new to ASP.Net and Crystal Reports. We have VS.Net 2003 and Crystal 10 where I work. I have successfully been able to view reports in a web page. My problem now is that I have a...
5
by: Sridhar | last post by:
Hi, I have created a web application. I have a data access dll to interact with database. I added this dll as a reference to the web application. Now let's say if I am calling a function in data...
0
by: ZRexRider | last post by:
Hi, I've written reports based on stored procedures that receive parameters and it usually seems straight forward. Today I would like to use Crystal Reports parameter interface t prompt for a...
2
by: Lauren Quantrell | last post by:
I can pass the XML below to a sproc from within a vb.net application but it doesn't work to the same sproc from an Access application. I've tried massaging the double quotes without success. Any...
1
by: JLeitner08 | last post by:
I have a report that has criteria in the query, that will ask for a starting and ending date, a location, and a type. Alone, the parameters work great for the report. Now I want to add a subreport...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.