473,748 Members | 9,416 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="VBSCR IPT" %>
<title>Make Report</title>

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

<!-- #include file="AlwaysReq uiredSteps.asp" -->

<%

userid = "userid"
Password= "pwd"

session("oRpt") .MorePrintEngin eErrorMessages = False
session("oRpt") .EnableParamete rPrompting = False

set crtable = session("oRpt") .Database.Table s.Item(1)
crtable.SetLogo nInfo "SERVER", "DB", cstr(userid),cs tr(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 StoredProcParam Collection = Session("oRpt") .ParameterField s

' - 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 = StoredProcParam Collection.item (1)
Set Param2 = StoredProcParam Collection.item (2)

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

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

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

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

userid = "userid"
Password= "pwd"

session("oRpt") .MorePrintEngin eErrorMessages = False
session("oRpt") .EnableParamete rPrompting = False

' Create Database object
set ReportDatabase2 = CRSubreports.Da tabase

'Database Table collection
Set crdatabasetable s2 = ReportDatabase2 .tables

set crtable2 = crdatabasetable s2.Item(1)
crtable2.SetLog onInfo "SERVER", "DB", cstr(userid),cs tr(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 StoredProcParam Collection = Session("oRpt") .ParameterField s

' - 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 = StoredProcParam Collection.item (1)
Set subParam2 = StoredProcParam Collection.item (2)

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

end if

%>
<!-- #include file="MoreRequi redSteps.asp" -->
<!-- #include file="SmartView erActiveX.asp" -->

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

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

Similar topics

6
6738
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 dd/mm/yyyy date) AND in sql server 2000 sp i have:
9
2827
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. The report is generated from a button on this form. In the button's onclick event a where clause is built and assigned to a public variable. Because of the multiselect listbox I use IN as part of the where clause, for example, sqlstr = " ...
1
2652
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 Analyzer. Anyone know how to make this work? Thanks, Paul
4
1830
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 and pass the info to the SQL box and it hiccups. I'll drop VS.NET into debug mode and step through the SPROCcreation and copy those values into Query Analyzer to get alittle more info. When I run the Query Analyer that data worksjust fine. What?! ...
0
1527
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 report that takes two parameters. A clientID parameter(number) and a date parameter(Date type). I set a form that gets the possible values from the DB and places them into drop down lists. When I select the params and click the button, I
5
1384
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 access and if it throws exception (like cannot find stored procedure), how do I retrieve that exception message back in the web form? In the client, I am able to catch the exception, but the message I am getting is "Object reference not set to an...
0
2854
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 "Date Range" and then pass the lower and upper date values to the @StartDate and @EndDate of my SPROC's range. Unfortunately when I try to build a report off of a SPROC havng two
2
1615
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 help is appreciated. lq XML text:
1
4118
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 for a summary, and I want the subreport to use the same criteria as the original. Right now I do not have any criteria in the subreport query, only in the original report query. When I link the subreport to the original report, using those fields that...
0
8984
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9312
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.