• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 683
  • Last Modified:

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
0
saunaG
Asked:
saunaG
  • 3
  • 3
1 Solution
 
frodomanCommented:
Have you tried running the report in Crystal and supplying the same parameters to make sure you get results?

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.
0
 
frodomanCommented:
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.
0
 
mlmccCommented:
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
saunaGAuthor Commented:
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.
0
 
frodomanCommented:
It sounds then like there may be an issue with your parameters.  Can you show the fragment of code where your parameter values are set?  Also give an example of the data value that would be passed?
0
 
saunaGAuthor Commented:
Is this the part you want:

Session("oRpt").ParameterFields.GetItemByName("StartDate").AddCurrentValue(CDate(Request.Form("textboxFromDate")))
Session("oRpt").ParameterFields.GetItemByName("EndDate").AddCurrentValue(CDate(Request.Form("textboxEndDate")))

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.
0
 
saunaGAuthor Commented:
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").ReadRecords

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("oPageEngine")) 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-CFB4-4357-85EF-CE3EBFE23A62"
      WIDTH=100% HEIGHT=99%
      CODEBASE="/crystalreportviewers11/ActiveXControls/ActiveXViewer.cab#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="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
      On Error Resume Next
      Dim webBroker
      Set webBroker = CreateObject("CrystalReports11.WebReportBroker.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("CrystalReports11.WebReportSource.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>
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now