<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Crystal Reports ASP Example - Using Stored Procedure Parameters</title>
<TITLE>Seagate ActiveX Viewer</TITLE>
</head>
<%
reportname= session("reportname")
servername = session("servername")
dbname = session("dbname")
userID= session("userID")
password = session("password")
newparam = request("paramname")
response.write "The report name is " & reportname & "<br>"
response.write "The parameter name is " & newparam & "<br>"
response.write "servername or dsn is " & servername & "<br>"
response.write "dbname is " & dbname & "<br>"
response.write "userid is " & userid & "<br>"
response.write "password is " & password & "<br>"
'reportname = "Report4.rpt"
%>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
CRViewer.ReportName = "rptserver.asp"
else
Dim webSource
Set webSource = CreateObject("WebReportSource.WebReportSource")
webSource.ReportSource = webBroker
webSource.URL = "rptserver.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize">
<br>
'<!-- #include file="AlwaysRequiredSteps.asp" -->
<%
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")
End If
Path = Request.ServerVariables("PATH_TRANSLATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if
%>
<%Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)
session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
%>
<%
session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
set crtable = session("oRpt").Database.Tables.Item(1)
crtable.SetLogonInfo cstr(servername),cstr(dbname),cstr(userID),cstr(password)
'response.write crtable.TestConnectivity & "<br>"
set StoredProcParamCollection = Session("oRpt").ParameterFields
Set ThisParam = StoredProcParamCollection.item(1) ----此为列81
ThisParam.SetCurrentValue (cstr(newparam)), 12
%>
'<!-- #include file="MoreRequiredSteps.asp" -->
<%
On Error Resume Next
session("oRpt").ReadRecords
If Err.Number <> 0 Then
Response.Write "An Error has occured on the server in attempting to access the data source"
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>
'<!-- #include file="SmartViewerActivex.asp" -->
<p>
<OBJECT ID="CRViewer"
CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
WIDTH=100% HEIGHT=95%
CODEBASE="/viewer/activeXViewer/activexviewer.cab#Version=8,0,0,224">
<PARAM NAME="EnableRefreshButton" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
CRViewer.ReportName = "rptserver.asp"
else
Dim webSource
Set webSource = CreateObject("WebReportSource.WebReportSource")
webSource.ReportSource = webBroker
webSource.URL = "rptserver.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</BODY>
</HTML>
错误信息:
Microsoft VBScript 执行阶段错误 错误 '800a0009'
数组索引超出范围
/marketing/aspxmps8/Intermediate/ADOdropsecure/paramreport.asp, 列81
16 个解决方案
#1
item(1) 从何而来?
有这样设置的吗
有这样设置的吗
#2
Set ThisParam = StoredProcParamCollection.item(1)问题好象出在这行。
#3
justify ThisParam is the object,then you can find the error,
#4
study
#5
存储过程有两个以上的参数吗?
#6
Originally posted by : Amarnath (amar_rajappa@lycos.com)
Hi,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Just set all the parameters , which u have created in the Crystal Report in ASP page.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example
=======
set session("ParamCollection") = Session("oRpt").Parameterfields
set Param1 = session("ParamCollection").Item(1)
////////////////////////////////////////////////
'This line creates an object to reference the first parameter in the
'report. You can also use the parameter name in the Item() statement.
////////////////////////////////////////////////
ParamValue = Request.Form("ParamValue")
'This line creates a temporary variable to store the value to pass to the paraemter field.
ParamValue = Request.Form("user")
' Depending on the Data type and Sizeset the value
Call Param1.SetCurrentValue (CStr(ParamValue), 12)
NOTE: The order of the parameters created in the Crystal report and creating parameters in ASP should match
Hope this help..
Regards
Amar
------------
Asif at 8/9/2002 6:02:31 AM
------------
I will tel u soon
i am also reserching it
and contact me on mail
by
Hi,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Just set all the parameters , which u have created in the Crystal Report in ASP page.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example
=======
set session("ParamCollection") = Session("oRpt").Parameterfields
set Param1 = session("ParamCollection").Item(1)
////////////////////////////////////////////////
'This line creates an object to reference the first parameter in the
'report. You can also use the parameter name in the Item() statement.
////////////////////////////////////////////////
ParamValue = Request.Form("ParamValue")
'This line creates a temporary variable to store the value to pass to the paraemter field.
ParamValue = Request.Form("user")
' Depending on the Data type and Sizeset the value
Call Param1.SetCurrentValue (CStr(ParamValue), 12)
NOTE: The order of the parameters created in the Crystal report and creating parameters in ASP should match
Hope this help..
Regards
Amar
------------
Asif at 8/9/2002 6:02:31 AM
------------
I will tel u soon
i am also reserching it
and contact me on mail
by
#7
Originally posted by : Amarnath (amar_rajappa@lycos.com)
Hi,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Just set all the parameters , which u have created in the Crystal Report in ASP page.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example
=======
set session("ParamCollection") = Session("oRpt").Parameterfields
set Param1 = session("ParamCollection").Item(1)
////////////////////////////////////////////////
'This line creates an object to reference the first parameter in the
'report. You can also use the parameter name in the Item() statement.
////////////////////////////////////////////////
ParamValue = Request.Form("ParamValue")
'This line creates a temporary variable to store the value to pass to the paraemter field.
ParamValue = Request.Form("user")
' Depending on the Data type and Sizeset the value
Call Param1.SetCurrentValue (CStr(ParamValue), 12)
NOTE: The order of the parameters created in the Crystal report and creating parameters in ASP should match
Hope this help..
Regards
Amar
------------
Asif at 8/9/2002 6:02:31 AM
------------
I will tel u soon
i am also reserching it
and contact me on mail
by
Hi,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Just set all the parameters , which u have created in the Crystal Report in ASP page.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example
=======
set session("ParamCollection") = Session("oRpt").Parameterfields
set Param1 = session("ParamCollection").Item(1)
////////////////////////////////////////////////
'This line creates an object to reference the first parameter in the
'report. You can also use the parameter name in the Item() statement.
////////////////////////////////////////////////
ParamValue = Request.Form("ParamValue")
'This line creates a temporary variable to store the value to pass to the paraemter field.
ParamValue = Request.Form("user")
' Depending on the Data type and Sizeset the value
Call Param1.SetCurrentValue (CStr(ParamValue), 12)
NOTE: The order of the parameters created in the Crystal report and creating parameters in ASP should match
Hope this help..
Regards
Amar
------------
Asif at 8/9/2002 6:02:31 AM
------------
I will tel u soon
i am also reserching it
and contact me on mail
by
#8
: yonghengdizhen(IUnknown::AddRef())
thank you very much,and i have a good idea!
but i have had solve it!thank you!
thank you very much,and i have a good idea!
but i have had solve it!thank you!
#9
另有一問:
我不能動態的賦值給報表模塊,也就是無法改變報表的sql where 條件!
請問哪一位有這樣的好例子?
如有請給我一份,我很需要,非常感謝,我會再加分!
lxd8789_cn1227@163.com
我不能動態的賦值給報表模塊,也就是無法改變報表的sql where 條件!
請問哪一位有這樣的好例子?
如有請給我一份,我很需要,非常感謝,我會再加分!
lxd8789_cn1227@163.com
#10
给你发了一份关于水晶报表的例子.当然代码是用于crystal report9.0的,所以在实现上你必须根据8.0的rdc接口进行适当的转换
#11
我收到了,我轉換接口了,但是不行,是不是還有其它地方有不對的,
還有那個ttx檔案是不是在水晶報表里做?有其它方式可以得到嗎?
oADOConnection.Open ("Xtreme Sample Database 9")
我沒有找到這個!能告訴我嗎?
還有那個ttx檔案是不是在水晶報表里做?有其它方式可以得到嗎?
oADOConnection.Open ("Xtreme Sample Database 9")
我沒有找到這個!能告訴我嗎?
#12
那是一个access数据库的系统数据源,实际上不局限于access数据库..
在我的代码中我使用的xml schema数据源提供ado数据集同样可以实现
hhx文件是在水晶报表中做的..是一个字段定义文件,只在设计阶段和报表更新时需要.
在我的代码中我使用的xml schema数据源提供ado数据集同样可以实现
hhx文件是在水晶报表中做的..是一个字段定义文件,只在设计阶段和报表更新时需要.
#13
学习
#14
yonghengdizhen(9.18=>警钟长鸣,勿忘国耻)
真是太謝謝你了.不過......
Xtreme Sample Database 9我知道那是系統數據源,但是沒有這個數據庫,我在測試時就是不能更新數據,在報表內容那塊是一片空白,沒有數據顯示,你給我的例子有許多的報表設計都打不開.是不是低版本的水晶報表不能打開高版本的水晶報表?
這個問題能盡快解決我可以把我的200+200+200給你.
真是太謝謝你了.不過......
Xtreme Sample Database 9我知道那是系統數據源,但是沒有這個數據庫,我在測試時就是不能更新數據,在報表內容那塊是一片空白,沒有數據顯示,你給我的例子有許多的報表設計都打不開.是不是低版本的水晶報表不能打開高版本的水晶報表?
這個問題能盡快解決我可以把我的200+200+200給你.
#15
up
#16
等我项目忙完了,我会认真的再和你讨论这个问题的
#1
item(1) 从何而来?
有这样设置的吗
有这样设置的吗
#2
Set ThisParam = StoredProcParamCollection.item(1)问题好象出在这行。
#3
justify ThisParam is the object,then you can find the error,
#4
study
#5
存储过程有两个以上的参数吗?
#6
Originally posted by : Amarnath (amar_rajappa@lycos.com)
Hi,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Just set all the parameters , which u have created in the Crystal Report in ASP page.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example
=======
set session("ParamCollection") = Session("oRpt").Parameterfields
set Param1 = session("ParamCollection").Item(1)
////////////////////////////////////////////////
'This line creates an object to reference the first parameter in the
'report. You can also use the parameter name in the Item() statement.
////////////////////////////////////////////////
ParamValue = Request.Form("ParamValue")
'This line creates a temporary variable to store the value to pass to the paraemter field.
ParamValue = Request.Form("user")
' Depending on the Data type and Sizeset the value
Call Param1.SetCurrentValue (CStr(ParamValue), 12)
NOTE: The order of the parameters created in the Crystal report and creating parameters in ASP should match
Hope this help..
Regards
Amar
------------
Asif at 8/9/2002 6:02:31 AM
------------
I will tel u soon
i am also reserching it
and contact me on mail
by
Hi,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Just set all the parameters , which u have created in the Crystal Report in ASP page.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example
=======
set session("ParamCollection") = Session("oRpt").Parameterfields
set Param1 = session("ParamCollection").Item(1)
////////////////////////////////////////////////
'This line creates an object to reference the first parameter in the
'report. You can also use the parameter name in the Item() statement.
////////////////////////////////////////////////
ParamValue = Request.Form("ParamValue")
'This line creates a temporary variable to store the value to pass to the paraemter field.
ParamValue = Request.Form("user")
' Depending on the Data type and Sizeset the value
Call Param1.SetCurrentValue (CStr(ParamValue), 12)
NOTE: The order of the parameters created in the Crystal report and creating parameters in ASP should match
Hope this help..
Regards
Amar
------------
Asif at 8/9/2002 6:02:31 AM
------------
I will tel u soon
i am also reserching it
and contact me on mail
by
#7
Originally posted by : Amarnath (amar_rajappa@lycos.com)
Hi,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Just set all the parameters , which u have created in the Crystal Report in ASP page.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example
=======
set session("ParamCollection") = Session("oRpt").Parameterfields
set Param1 = session("ParamCollection").Item(1)
////////////////////////////////////////////////
'This line creates an object to reference the first parameter in the
'report. You can also use the parameter name in the Item() statement.
////////////////////////////////////////////////
ParamValue = Request.Form("ParamValue")
'This line creates a temporary variable to store the value to pass to the paraemter field.
ParamValue = Request.Form("user")
' Depending on the Data type and Sizeset the value
Call Param1.SetCurrentValue (CStr(ParamValue), 12)
NOTE: The order of the parameters created in the Crystal report and creating parameters in ASP should match
Hope this help..
Regards
Amar
------------
Asif at 8/9/2002 6:02:31 AM
------------
I will tel u soon
i am also reserching it
and contact me on mail
by
Hi,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Just set all the parameters , which u have created in the Crystal Report in ASP page.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example
=======
set session("ParamCollection") = Session("oRpt").Parameterfields
set Param1 = session("ParamCollection").Item(1)
////////////////////////////////////////////////
'This line creates an object to reference the first parameter in the
'report. You can also use the parameter name in the Item() statement.
////////////////////////////////////////////////
ParamValue = Request.Form("ParamValue")
'This line creates a temporary variable to store the value to pass to the paraemter field.
ParamValue = Request.Form("user")
' Depending on the Data type and Sizeset the value
Call Param1.SetCurrentValue (CStr(ParamValue), 12)
NOTE: The order of the parameters created in the Crystal report and creating parameters in ASP should match
Hope this help..
Regards
Amar
------------
Asif at 8/9/2002 6:02:31 AM
------------
I will tel u soon
i am also reserching it
and contact me on mail
by
#8
: yonghengdizhen(IUnknown::AddRef())
thank you very much,and i have a good idea!
but i have had solve it!thank you!
thank you very much,and i have a good idea!
but i have had solve it!thank you!
#9
另有一問:
我不能動態的賦值給報表模塊,也就是無法改變報表的sql where 條件!
請問哪一位有這樣的好例子?
如有請給我一份,我很需要,非常感謝,我會再加分!
lxd8789_cn1227@163.com
我不能動態的賦值給報表模塊,也就是無法改變報表的sql where 條件!
請問哪一位有這樣的好例子?
如有請給我一份,我很需要,非常感謝,我會再加分!
lxd8789_cn1227@163.com
#10
给你发了一份关于水晶报表的例子.当然代码是用于crystal report9.0的,所以在实现上你必须根据8.0的rdc接口进行适当的转换
#11
我收到了,我轉換接口了,但是不行,是不是還有其它地方有不對的,
還有那個ttx檔案是不是在水晶報表里做?有其它方式可以得到嗎?
oADOConnection.Open ("Xtreme Sample Database 9")
我沒有找到這個!能告訴我嗎?
還有那個ttx檔案是不是在水晶報表里做?有其它方式可以得到嗎?
oADOConnection.Open ("Xtreme Sample Database 9")
我沒有找到這個!能告訴我嗎?
#12
那是一个access数据库的系统数据源,实际上不局限于access数据库..
在我的代码中我使用的xml schema数据源提供ado数据集同样可以实现
hhx文件是在水晶报表中做的..是一个字段定义文件,只在设计阶段和报表更新时需要.
在我的代码中我使用的xml schema数据源提供ado数据集同样可以实现
hhx文件是在水晶报表中做的..是一个字段定义文件,只在设计阶段和报表更新时需要.
#13
学习
#14
yonghengdizhen(9.18=>警钟长鸣,勿忘国耻)
真是太謝謝你了.不過......
Xtreme Sample Database 9我知道那是系統數據源,但是沒有這個數據庫,我在測試時就是不能更新數據,在報表內容那塊是一片空白,沒有數據顯示,你給我的例子有許多的報表設計都打不開.是不是低版本的水晶報表不能打開高版本的水晶報表?
這個問題能盡快解決我可以把我的200+200+200給你.
真是太謝謝你了.不過......
Xtreme Sample Database 9我知道那是系統數據源,但是沒有這個數據庫,我在測試時就是不能更新數據,在報表內容那塊是一片空白,沒有數據顯示,你給我的例子有許多的報表設計都打不開.是不是低版本的水晶報表不能打開高版本的水晶報表?
這個問題能盡快解決我可以把我的200+200+200給你.
#15
up
#16
等我项目忙完了,我会认真的再和你讨论这个问题的