Hi All,
I am trying to call a parameterized report from ASP. When I am trying to run the html and enter value and click Preview Report,
it's giving me an error like
An Error has occured. Please check the ASP page.
Error 13 Type mismatch
Can anybody tell me where the bug is?
in HTML
I have a textbox (txtMonth) and a Preview Report Button,
and Report is created in Crystal Report 9, with a parameter of data type string where I usally enter like 0501 (i.e JAN 05).
ASP page code:
<%@ Language=VBScript %>
<%
ReportName = MID(request.ServerVariables("PATH_TRANSLATED"), 1, (LEN(request.ServerVariables("PATH_TRANSLATED"))-18)) & "YrSales.rpt"
On Error Resume Next
If Not IsObject ( session("oApp") ) Then
Set session ("oApp") = Server.CreateObject("CrystalRuntime.Application")
End If
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if
Set session("oRpt") = session("oApp").OpenReport(ReportName,1)
session("oRpt").DiscardSavedData
If Request.Form("txtMonth") = "" Then
session("oRpt").ParameterFields(1).AddCurrentValue(0)
Else
session("oRpt").ParameterFields(1).AddCurrentValue(CInt(Request.Form("txtMonth")))
End If
If Err.Number <> 0 Then
Response.Write "An Error has occured. Please check the ASP page.<BR>"
Response.Write "Error " & Err.number & " " & Err.description
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
Session("GroupTree") = Request.Form("chkGroupTree")
%>
<!-- #include file="SmartViewerActiveX.asp" -->
Thank You,
Gragi
I am trying to call a parameterized report from ASP. When I am trying to run the html and enter value and click Preview Report,
it's giving me an error like
An Error has occured. Please check the ASP page.
Error 13 Type mismatch
Can anybody tell me where the bug is?
in HTML
I have a textbox (txtMonth) and a Preview Report Button,
and Report is created in Crystal Report 9, with a parameter of data type string where I usally enter like 0501 (i.e JAN 05).
ASP page code:
<%@ Language=VBScript %>
<%
ReportName = MID(request.ServerVariables("PATH_TRANSLATED"), 1, (LEN(request.ServerVariables("PATH_TRANSLATED"))-18)) & "YrSales.rpt"
On Error Resume Next
If Not IsObject ( session("oApp") ) Then
Set session ("oApp") = Server.CreateObject("CrystalRuntime.Application")
End If
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if
Set session("oRpt") = session("oApp").OpenReport(ReportName,1)
session("oRpt").DiscardSavedData
If Request.Form("txtMonth") = "" Then
session("oRpt").ParameterFields(1).AddCurrentValue(0)
Else
session("oRpt").ParameterFields(1).AddCurrentValue(CInt(Request.Form("txtMonth")))
End If
If Err.Number <> 0 Then
Response.Write "An Error has occured. Please check the ASP page.<BR>"
Response.Write "Error " & Err.number & " " & Err.description
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
Session("GroupTree") = Request.Form("chkGroupTree")
%>
<!-- #include file="SmartViewerActiveX.asp" -->
Thank You,
Gragi