รบกวนสอบถามผู้รู้หน่อยครับ มีปัญหาว่า เมื่อก่อนผมใช้ ASP กับ Crystal Report 9 บน windows2000 server ใช้ได้ปกติ แต่พอเปลี่ยนมาเป็น Windows 2003 Server แล้วทำไม Preview ออกมาหน้ากระดาษเป็นแนวตั้งหมดเลย ทั้งที่ set ไว้แนวนอน แก้ไงดีครับ
<%@language = vbscript%>
<%
Set oApp = CreateObject("CrystalRuntime.Application").
reportname = "announceReport.rpt" - reportname is the string variable which would pass the rpt file
to the OpenReport method
'CREATE THE APPLICATION OBJECT
'======================================
'Creates the application object (session("oApp")) which loads the Crystal Reports automation server
(cpeaut31.dll) into the memory
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("Crystal.CRPE.Application")
End If
' CREATE THE REPORT OBJECT
'================================
'The Report object is created by calling the Application object's OpenReport method.
'OPEN THE REPORT (but destroy any previous one first)
'======================================
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if
set Session("options") = Session("oApp").options
Session("options").MatchLogonInfo = 1
Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)
set crtable1 = session("oRpt").Database.Tables.Item("hosp_unit_all")
crtable1.SetLogonInfo "icom", " ", "hr", "hr"
set session("oRptOptions") = Session("oRpt").Options
session("oRptOptions").MorePrintEngineErrorMessages = 0
'These lines disable the Error reporting mechanism included the built into the
'Crystal Report Print Engine (CRPE32.DLL)
'=============================================================
' 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 "An Error has occured on the server in attempting to access the data source"
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
'Response.Write "An Error has occured on the server in attempting to access the data source"
' INSTANTIATE THE CRYSTAL REPORTS SMART VIEWER
%>