473,722 Members | 2,295 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.


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

'============== =============== =============== =============== =======

' - 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)

'============== =============== =============== =============== =======

' - 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 5440

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

Similar topics

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:
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 = " ...
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
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?! ...
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
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...
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
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:
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...
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...
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...
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...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.