saunaG
asked on
Blank report displayed in viewer when called from asp page
I am new to crystal, have the eval version of CR11 Developer Edition.
I created a report and use asp code to display the report from a web page in the activeX viewer. I did all this using sample code from business objects.
I am trying to do the same now with a report with dynamic parameters.
So I have a html form that passes a start and end date to an asp page that calls the report but when the report is run it just opens the viewer with no report inside. The date range i choose definetly contains data. I think the dates are being passed properly because first i had a type mismatch error from passing my parameters but now it is gone after i converted the text values my dates are stored as to dates.
Can anyone point me in the right direction?
I don't really know asp but have some programming experience - i am just reusing the sample code.
Thanks
I created a report and use asp code to display the report from a web page in the activeX viewer. I did all this using sample code from business objects.
I am trying to do the same now with a report with dynamic parameters.
So I have a html form that passes a start and end date to an asp page that calls the report but when the report is run it just opens the viewer with no report inside. The date range i choose definetly contains data. I think the dates are being passed properly because first i had a type mismatch error from passing my parameters but now it is gone after i converted the text values my dates are stored as to dates.
Can anyone point me in the right direction?
I don't really know asp but have some programming experience - i am just reusing the sample code.
Thanks
You may also want to check out this information: http://support.businessobjects.com/library/kbase/articles/c2004405.asp Particularly the part about an older version of the Active-X viewer already installed on the machine.
This one may also be useful
http://support.businessobjects.com/library/kbase/articles/c2011492.asp
mlmcc
http://support.businessobjects.com/library/kbase/articles/c2011492.asp
mlmcc
ASKER
my report works in crystal and there is a report header which is basically a title page with some text - no data
my activex viewer is working too - i can view other reports without problems. i can view the exact same report i am having the problem with when i remove the parameters from it.
my activex viewer is working too - i can view other reports without problems. i can view the exact same report i am having the problem with when i remove the parameters from it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is this the part you want:
Session("oRpt").ParameterF ields.GetI temByName( "StartDate ").AddCurr entValue(C Date(Reque st.Form("t extboxFrom Date")))
Session("oRpt").ParameterF ields.GetI temByName( "EndDate") .AddCurren tValue(CDa te(Request .Form("tex tboxEndDat e")))
i think this part is ok because when i first created my html form that passes these values, i did not use the CDate function here to convert the input type text string and got a type mismatch error. After i added the CDate function above the error disappeared and i get the blank report viewer.
Session("oRpt").ParameterF
Session("oRpt").ParameterF
i think this part is ok because when i first created my html form that passes these values, i did not use the CDate function here to convert the input type text string and got a type mismatch error. After i added the CDate function above the error disappeared and i get the blank report viewer.
ASKER
After that code there are 2 include files:
<%
'========================= ========== ========== ========== ========== ========== =========
' Retrieve the Records and Create the "Page on Demand" Engine Object
'========================= ========== ========== ========== ========== ========== =========
'On Error Resume Next
session("oRpt").ReadRecord s
If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
Else
If IsObject(session("oPageEng ine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>
<%
'This file contains the HTML code to instantiate the Smart Viewer ActiveX.
'
'You will notice that the Report Name parameter references the RDCrptserver10.asp file.
'This is because the report pages are actually created by RDCrptserver10.asp.
'RDCrptserver10.asp accesses session("oApp"), session("oRpt") and session("oPageEngine")
'to create the report pages that will be rendered by the ActiveX Smart Viewer.
'
%>
<HTML>
<HEAD>
<TITLE>Crystal Reports ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 ONUNLOAD="CallDestroy();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer"
CLASSID="CLSID:460324E8-CF B4-4357-85 EF-CE3EBFE 23A62"
WIDTH=100% HEIGHT=99%
CODEBASE="/crystalreportvi ewers11/Ac tiveXContr ols/Active XViewer.ca b#Version= 11,0,0,893 " VIEWASTEXT>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<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="EnableAnimationContr ol" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("CrystalRepor ts11.WebRe portBroker .1")
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."
else
Dim webSource
Set webSource = CreateObject("CrystalRepor ts11.WebRe portSource .1")
webSource.ReportSource = webBroker
webSource.URL = "RDCrptserver11.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
<script language="javascript">
function CallDestroy()
{
window.open("Cleanup.asp") ;
}
</script>
</BODY>
</HTML>
<%
'=========================
' Retrieve the Records and Create the "Page on Demand" Engine Object
'=========================
'On Error Resume Next
session("oRpt").ReadRecord
If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
Else
If IsObject(session("oPageEng
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>
<%
'This file contains the HTML code to instantiate the Smart Viewer ActiveX.
'
'You will notice that the Report Name parameter references the RDCrptserver10.asp file.
'This is because the report pages are actually created by RDCrptserver10.asp.
'RDCrptserver10.asp accesses session("oApp"), session("oRpt") and session("oPageEngine")
'to create the report pages that will be rendered by the ActiveX Smart Viewer.
'
%>
<HTML>
<HEAD>
<TITLE>Crystal Reports ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 ONUNLOAD="CallDestroy();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer"
CLASSID="CLSID:460324E8-CF
WIDTH=100% HEIGHT=99%
CODEBASE="/crystalreportvi
<PARAM NAME="EnableRefreshButton"
<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"
<PARAM NAME="EnableAnimationContr
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("CrystalRepor
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."
else
Dim webSource
Set webSource = CreateObject("CrystalRepor
webSource.ReportSource = webBroker
webSource.URL = "RDCrptserver11.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
<script language="javascript">
function CallDestroy()
{
window.open("Cleanup.asp")
}
</script>
</BODY>
</HTML>
Also, if you don't have it already, you should make sure your report has some static text in the Report Header section - that way even if there's a data-related problem you should at least see the static text in the viewer. This will at least narrow down if the report is actually displaying or not.