Reports do not work without MSJVM

For you Crystal report experts with ASP experience: I have a few clients that use my VB6 application that calls Crystal reports from an asp page.  I have been mostly happy and successful using Crystals' supplied ReportsJava.asp ... until XPsp1 where the clients did not have the MS Java Virtual Machine.  If i install Sun's Java, the reports DO NOT WORK (just get the little square in the top left hand corner).    I've tried to use ActiveXviewer but I guess there is a conflict with .Net and server 2003 and the older com objects.  The HTMstart.asp page looks adequate except it does not offer a print option (kinda of useless) .  

I need a solution but not sure which way to look.  In my newer applications, I use .Net and stream crystal reports to a pdf file on the fly.  But I don't know if this is viable in the older VB6.0 world.

Any input/suggestions would be most appreciated.
Who is Participating?
mlmccConnect With a Mentor Commented:
What version of Crystal?  

Could you export the reports from the VB6 app to PDF files and display them?

Have you considered using the DHTML viewer - I believe this is the recommended viewer for use with .net framework.  You are correct that the ActiveX viewer won't work with .Net:

LanWorksAuthor Commented:
Sorry, I didn't explain myself very well.  The problem is with the older ASP and VB6 app, not the newer .Net.  Do they have a DHTML viewer for ASP?
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

You don't have to use .Net with the dhtml viewer:

Dim viewer
Set viewer = CreateObject("CrystalReports.CrystalReportInteractiveViewer")

mlmcc's idea of exporting to PDF is a good idea also that may work for you.

LanWorksAuthor Commented:
I'm using version 8.5 developer edition. Do they have a CrystalReportInteractiveViewer (I do not see any thing about it in the documentation indexes).

I too like the idea of exporting it to PDF.  I am using PUSH technology (meaning I create the report using a TTX file and send it an ADO recordset on the fly).  So how would I go about pushing it the recordset and then exporting it to pdf?  (Note that I'm not stuck on this solution, I'm still looking for an easy fix to displaying reports without the MSVJM if there is one)
Assuming you have the developer edition of CR8.5 here are some sample applications in ASP

LanWorksAuthor Commented:
The options offered in the samples are:

The HTMLpage does not offer a print button
ActiveXviewer seems to conflict with my .Net installation and gives a memory write error
JavaPlugin is what I'm trying to solve.  It works with MSVJM but not the Sun Java.

Any other suggestions?
According to what I've seen, the DHTML viewer should be with CR8.5 although it's probably an optional install that may have been bypassed.  I don't have 8.5 any more, but according to this document ( ) it's part of the 8.5 Developer edition.

LanWorksAuthor Commented:
I've searched the CD without luck.  There is a comment however in help (search for DHTML) about referring to the enterprise CD.  But I could find no ASP files on the Enterprise CD.  Do you know the name of the file I'm supposed to be looking for?
I think the file you want is Exlate32.dll but I'm not certain.  Also I don't know if it's compacted or not.

You can probably just try to run install and select 'Custom' and see if it's on there.

LanWorksAuthor Commented:
Stuff happens.  I tried a dozen different ways, but no matter, I could not get my enterprise CD to accept the keycode as printed on the back so I could not even start the install.  I then spent a while looking at the files on the CD hoping I could find what I needed ... again no luck.

I then went back to the idea of exporting to PDF. I borrowed a function to export to pdf (fnblnExportReport) from Manish Sharma and then used javascript to open a new window with the file and it works ... in fact, it works better then the old ReportsJava.asp because it seems faster and I don't have the double take as it closes the second window.

The only messy part is I leave a copy of the pdf on the intranet server which I'll have to clean up later (but this is adequate for this helpdesk app that has less then 100 users)

My problem is how to be fair awarding the points.  frodoman, I really appreciate your input, but since I went back to the PDF solution, I'll have to accept mlmcc answer.  But I'm not sure of the proper netiquette so please advise.

Thanks and kindest regards,

The details to the solution used (as used in the ActiveX.dll):

Public Function PrintToPDF()
    Dim strErrMsg As String
    Dim sSql As String
    Dim sFile As String
    sFile = modObjSession.SessionID & ".PDF"
    If fnblnExportReport(modObjSession("oRpt"), "PDF", GetPath, sFile, strErrMsg) = False Then
        modObjResponse.Write "Failed to write PDF"
        sSql = "<SCRIPT LANGUAGE=""JavaScript"">"
        sSql = sSql & """" & sFile & ""","""",""menubar=no toolbar=no resizable=yes scrollbars=yes"")"
        sSql = sSql & "</script>"
        modObjResponse.Write sSql
    End If
End Function
Function fnblnExportReport(oRpt, strFormat, strpath, strfilename, strErrMsg) As Boolean
    On Error Resume Next
    Dim CrExportOptions
    Set CrExportOptions = oRpt.ExportOptions
    With CrExportOptions
       Select Case strFormat
          Case "PDF"
            .FormatType = 31
            .PDFExportAllPages = True
            .DestinationType = 1 'crEDTDiskFile
            .DiskFileName = strpath & "\" & strfilename
            .UseReportNumberFormat = False
            .UseReportDateFormat = False
       End Select
     End With
    oRpt.Export False
    If Err.Number <> 0 Then
        strErrMsg = Err.Number & " : " & Err.Description
        fnblnExportReport = False
        strErrMsg = ""
        fnblnExportReport = True
    End If
    Set CrExportOptions = Nothing
End Function
Private Function GetPath() As String
    Dim path As String
    Dim iLen As Integer
    path = modObjRequest.ServerVariables("PATH_TRANSLATED")
    While (Right(path, 1) <> "\" And Len(path) <> 0)
        iLen = Len(path) - 1
        path = Left(path, iLen)
    GetPath = path
End Function
Looks like youfigured it out.

Glad I could help

LanWorksAuthor Commented:
My euphoria quickly subsided when it did not work on my Win 2003 production server.  But that problem is not related to this solution so I opend a new Question : PDF export gives error -2147417848 Method '~' of object '~'
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.