ASP Call Crystal Report with Store Procedure(1)

Come from http://support.seagatesoftware.com/

'SimpleStoredProcParam.asp

<%@ LANGUAGE="VBSCRIPT" %>
<title>Crystal Reports ASP Example - Using Stored Procedure Parameters</title>
<%
'==============================================================================
' WORKING WITH THE REPORT DESIGNER COMPONENT AND ASP TO USE STORED PROCEDURES
' AND PASS VALUES TO STORED PROCEDURE PARAMETERS
'==============================================================================
'
' CONCEPT
' The Application object (oApp) is needed so that we can create the
' report object.
' Once we have created the report object (oRpt), we can then
' gain access to such things the "DatabaseParameters" in that
' report.
'
' ALWAYS REQUIRED STEPS (contained in AlwaysRequiredSteps.asp)
' - create the application object
' - create the report object
' - open the report
'
' WORK WITH STORED PROCEDURE PARAMETERS
' - get the database in the report
' - get the database's Stored Procedure Parameters
' - get the specific Store Procedure Parameter
' - save the new value to the Stored Proc Param
'
' MORE ALWAYS REQUIRED STEPS
' - retrieve the records
' - create the page engine
'
' DISPLAY THE REPORT
' - display the report using a smart viewer
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

'==================================================================
'==================================================================
' ALWAYS REQUIRED STEPS
'
' Include the file AlwaysRequiredSteps.asp which contains the code
' for steps:
' - create the application object
' - create the report object and open the report

%>

<%
' This is the name of the report being used in this example.
' This variable is being used in the AlwaysRequiredSteps.asp
' To use a different report, change it here.

reportname = "SimpleStoredProcParam.rpt"

%>

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

<%
' If it is easier to understand, simply delete the line above,
' and replace it with the entire contents of the file
' AlwaysRequiredSteps.asp
'==================================================================
'==================================================================
' LOG ONTO THE EXAMPLES SYTEM DSN AGAINST MS SQL SERVER "PUBS" SAMPLE DATABASE

userid = "sa"
Password= ""

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

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

'Create a System DSN called "Automation" pointing to the "pubs" database on SQL Server.
' Add your database's username and password to the SimpleStoredProcParam.asp page where indicated.
'==================================================================
'==================================================================
' 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 ThisParam = StoredProcParamCollection.item(1)
Set ThisParam2 = StoredProcParamCollection.item(2)
Set ThisParam3 = StoredProcParamCollection.item(3)

' - save the new value to the Stored Proc Param
' Create a variable and store the new value for the Stored Procedure
' in

时间: 2024-12-27 12:35:05

ASP Call Crystal Report with Store Procedure(1)的相关文章

ASP Call Crystal Report with Store Procedure(2)

'ActiveXPluginViewer.asp <html><head><title>Seagate Report Viewer Plug-In</title></head><body bgcolor=C6C6C6><P align="center"><script language="javascript">document.writeln('<EMBED na

ASP Call Crystal Report with Store Procedure(4)

'SPString.SQL if exists (select name from sysobjects where name = 'SPROCString') drop proc SPROCString GO CREATE PROCEDURE SPROCString @pTitle varchar(80) AS SET NOCOUNT ON SELECT *FROM TitleView WHERE Title = @pTitle or @pTitle = '*' 'toolbar.asp <%

ASP Call Crystal Report with Store Procedure(6)

'rptserver.asp Case "SRCH" Call RetrieveObjects Call CheckForError ' create page variable gvPageNumber = CInt(PAGE) Select Case VFMT Case "ENCP" if goPageGenerator.FindText(TEXT, 0, gvPageNumber) then Response.ContentType = EMFMIMETYPE

ASP Call Crystal Report with Store Procedure(3)

'framepage.asp <%' 05/02/98' Added the following features:' Page Expiry Time' - The page will expire when downloaded by browser so that user is insured that all data' will be current.Response.Expires = 0%><html><title></title><%

ASP Call Crystal Report with Store Procedure(5)

<%@ LANGUAGE="VBSCRIPT" %><%On Error Resume Next ' The oEMF object is a helper object to create EMFs (Ecapsulated Messages) for the viewers.' The viewers use EMFs to display errors and navigate to specific pages of the report. If Not Is

ASP Call Crystal Report with Store Procedure(7)

'SmartViewerActiveX.asp <HTML><HEAD><TITLE>Seagate ActiveX Viewer</TITLE></HEAD><BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize"> <OBJECT ID="CRViewer" CLASSID="CLSID:C4847596-

ASP.NET中利用Crystal Report创建图表

asp.net|创建|图表 在很多的应用程序中,报表是不可缺少的,一张好的报表能直观地让人把握数据的情况,方便决策.在这篇文章中,我们将以一个三层结构的asp.net程序为例,介绍如何使用crystal report ,来制作一份报表,其中介绍了不少asp.net和水晶报表的技巧. 在这个例子中,我们设想的应用要为一个销售部门制作一份报表,管理者可以查看某段时间之内的销售情况,以列表或者折线图的形式反映出销售的趋势.我们将使用SQL Server 2000做为数据库,使用VB.NET编写中间层逻

Visual Studio 2012使用水晶报表Crystal Report

原文:Visual Studio 2012使用水晶报表Crystal Report SAP在 2013年1月14日 released SAP Crystal Reports,developer version for Microsoft Visual Studio - 2012 .你可以从下面链接下载:http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_5.exe 下载并安装入你的电脑.安装 完毕,可以看到那些曾经熟

VS2005+Crystal Report开发Web应用

web 提要 本文试验将帮助你创建一个使用Crystal Report的Web应用程序-报告中的数据来源于一个对象集合,你将创建一个专门的类来保存股票市场数据. 一. 开发目标 结束本试验后,你将能够更好地: · 创建一个专门的类来保存股票市场值. · 实例化这个类. · 使用数据填充一个对象集合. · 通过一个web表单动态地添加数据. · 使用Crystal Report Designer熟练地创建一个水晶报表. 二. 内容说明 本实验将引导你创建一个Crystal Reports web应