mthakershi
Programmer
Hi All,
I am new to this forum and new to Crystal Reports too. I am facing problems in RPT to PDF conversion from ASP.
The project for which this conversion is to be provided has MS SQL Server 2000 backend and Crystal Reports 7.0 as reporting tool.
I found that there is no direct conversion possible with Crystal 7.0 runtime (tried with converting to XLS and RTF inbetween) from RPT to PDF. There is direct conversion possible with Crystal 8.5 runtime. So I tested it.
The original 7.0 reports have database driver as "PDSSQL.DLL" and when I tried either LogonServer or SetLogonInfo methods in ASP, it is getting me error "Server has not been opened yet."
When I prepared new report with 8.5 and set database driver to "PDSOLEDB.DLL", it is working fine and fluent. So it comes out like I have to create reports once again. Because when I upgrade 7.0 reports to 8.5 and set database driver to "PDSOLEDB.DLL", it is not working at all (even crystal report application is hanging when I refresh the upgraded report).
Here is the code I am using for it (I just got it from samples)
_______________________________________
<%
reportname = "VendorSchedule85.rpt"
<!--#include file="VendorSchedule.inc"-->
<%
Set session("oApp" = Server.CreateObject("CrystalRuntime.Application"
path = "D:\"
If IsObject(session("oRpt") then
Set session("oRpt" = nothing
End if
session("oApp".LogOnServer "pdssql.dll","server","db","sa",""
Set session("oRpt" = session("oApp".OpenReport(path & reportname, 1)
<<Setlogoninfo if not using logon server........>>>
session("oRpt".DiscardSavedData
<<making and giving report object query.......>>>>
session("oRpt".SQLQueryString = cstr(strSt)
session("oRpt".MorePrintEngineErrorMessages = False
session("oRpt".EnableParameterPrompting = False
session("filename" ="malay.pdf"
session("filetype" = "Adobe PDF"
Set session("ExportOptions" = Session("oRpt".ExportOptions
session("ExportFileName" = "c:\" + cstr(session("filename")
Select Case cstr(session("filetype")
Case "Adobe PDF" ExportType = 31
End Select
If (cint(ExportType) <> 24) then
session("ExportOptions".DiskFileName = session("ExportFileName"
Else
session("ExportOptions".HTMLFileName = session("ExportFileName"
End If
If cint(ExportType) = 10 then
session("ExportOptions".NumberofLinesPerPage = 50
End if
session("ExportOptions".FormatType = cint(ExportType)
session("ExportOptions".DestinationType = 1
Session("oRpt".Export False
<end of sample code.......>
_______________________________________
Please guide me. I think that there is problem with the dll only (because in other cases it is working without logonserver method).
Thanks,
Malay M. Thakershi
I am new to this forum and new to Crystal Reports too. I am facing problems in RPT to PDF conversion from ASP.
The project for which this conversion is to be provided has MS SQL Server 2000 backend and Crystal Reports 7.0 as reporting tool.
I found that there is no direct conversion possible with Crystal 7.0 runtime (tried with converting to XLS and RTF inbetween) from RPT to PDF. There is direct conversion possible with Crystal 8.5 runtime. So I tested it.
The original 7.0 reports have database driver as "PDSSQL.DLL" and when I tried either LogonServer or SetLogonInfo methods in ASP, it is getting me error "Server has not been opened yet."
When I prepared new report with 8.5 and set database driver to "PDSOLEDB.DLL", it is working fine and fluent. So it comes out like I have to create reports once again. Because when I upgrade 7.0 reports to 8.5 and set database driver to "PDSOLEDB.DLL", it is not working at all (even crystal report application is hanging when I refresh the upgraded report).
Here is the code I am using for it (I just got it from samples)
_______________________________________
<%
reportname = "VendorSchedule85.rpt"
<!--#include file="VendorSchedule.inc"-->
<%
Set session("oApp" = Server.CreateObject("CrystalRuntime.Application"
path = "D:\"
If IsObject(session("oRpt") then
Set session("oRpt" = nothing
End if
session("oApp".LogOnServer "pdssql.dll","server","db","sa",""
Set session("oRpt" = session("oApp".OpenReport(path & reportname, 1)
<<Setlogoninfo if not using logon server........>>>
session("oRpt".DiscardSavedData
<<making and giving report object query.......>>>>
session("oRpt".SQLQueryString = cstr(strSt)
session("oRpt".MorePrintEngineErrorMessages = False
session("oRpt".EnableParameterPrompting = False
session("filename" ="malay.pdf"
session("filetype" = "Adobe PDF"
Set session("ExportOptions" = Session("oRpt".ExportOptions
session("ExportFileName" = "c:\" + cstr(session("filename")
Select Case cstr(session("filetype")
Case "Adobe PDF" ExportType = 31
End Select
If (cint(ExportType) <> 24) then
session("ExportOptions".DiskFileName = session("ExportFileName"
Else
session("ExportOptions".HTMLFileName = session("ExportFileName"
End If
If cint(ExportType) = 10 then
session("ExportOptions".NumberofLinesPerPage = 50
End if
session("ExportOptions".FormatType = cint(ExportType)
session("ExportOptions".DestinationType = 1
Session("oRpt".Export False
<end of sample code.......>
_______________________________________
Please guide me. I think that there is problem with the dll only (because in other cases it is working without logonserver method).
Thanks,
Malay M. Thakershi