View a Crystal Report with ASP

Posted on 2004-11-03
Last Modified: 2012-06-27
Hello All,
I have been asked to provide a way to view crystal reports on our Intranet.  We are using an IIS6.0 box with a RAS Server and  Crystal Reports 9.  I have been trying to test out viewing a report with code that has been posted elsewhere in EE, but all I get is a white square with a red X.  I am trying to create the CRViewer ActiveX with ASP.
Any Help would be greatly appreciated.
Question by:ChadMarsh
    LVL 13

    Accepted Solution

    There could be a variety of reasons the red x appears the most likely of which is that IE is set to ignore ActiveX Controls.  If it were me I'd start out my testing using the InteractiveViewer(CrystalReportsInteractiveViewer.asp).  Once you are comfortable with this then move to the ActiveXViewer. There are plenty of samples on the Crystal Web site but here's mine which calls a simple report with no parameters and renders the report into HTML using CrystalReportsIneractiveViewer.asp:

    Set objFactory = CreateObject("CrystalReports.ObjectFactory")
    Set Session("oClientDoc") = objFactory.CreateObject("CrystalClientDoc.ReportClientDocument")      
    Dim path, iLen, x
    path = Request.ServerVariables("PATH_TRANSLATED")                    
    While (Right(path, 1) <> "\" And Len(path) <> 0)                      
    iLen = Len(path) - 1                                                  
    path = Left(path, iLen)                                              
    'Reportname = "MyReport.rpt"  
    Session("oClientDoc").Open path & reportName
     Session("oClientDoc").DatabaseController.Logon "mylogin","mypassword"
    Response.Redirect "CrystalReportsInteractiveViewer.asp"
    LVL 2

    Author Comment

    Thanks for the code.  I tried running it and got the following

    Analysis Server error '80004005'

    Access denied. Please check directory setting for files you can access.

    /IntranetReports/InteractiveViewer.asp, line 12

    You'll have to forgive my ignorance, but in the line:
     Session("oClientDoc").DatabaseController.Logon "mylogin","mypassword"
    is this a login and password for the RAS server.  I replaced your variables with what I thought
    was my login and password.
    Thanks for you help.
    LVL 2

    Author Comment

    I played with your code a little more and got it to work.
    Thanks for you help

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    Summer note focus on load 19 130
    IIS POST request being ignored 4 41
    Creating TABS in ASP Classic NOT using DIV 22 52
    Update field in order 21 95
    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now