View a Crystal Report with ASP

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.
Who is Participating?
TommyTupaConnect With a Mentor Commented:
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"
ChadMarshAuthor Commented:
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.
ChadMarshAuthor Commented:
I played with your code a little more and got it to work.
Thanks for you help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.