私はCrystal Reportsをほとんど公開していない.Net 3.5 Webアプリケーションを持っています。Web Cyrstalレポートは開発マシンで正常に動作しますが、テストサーバーでは正常に動作しません。
私の開発環境では問題なく動作しますが、テストサーバーにコードをコピーすると、空白のページしか表示されません。コードページの
があるHTML
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CrystalReport.aspx.vb"
Inherits="Woodland.CrystalReport" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Report</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<CR:CrystalReportViewer ID="rv1" runat="server" Visible="true" AutoDataBind="false" />
</form>
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
</CR:CrystalReportSource>
</body>
</html>
分離コード
以下Imports CrystalDecisions.Web
Imports CrystalDecisions.CrystalReports.Engine
Partial Public Class CrystalReport
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim CR As New ReportDocument
Dim paramList As New List(Of ParameterBO)
paramList = Session("ReportParams")
Dim path As String = Server.MapPath(Configuration.ConfigurationSettings.AppSettings("CrystalReportPath").ToString() & Session("ReportName").ToString())
CR.Load(path)
For Each param As ParameterBO In paramList
If Not param.ParameterValue = "" Then
CR.SetParameterValue(param.ParameterName, "'" & param.ParameterValue & "'")
Else
CR.SetParameterValue(param.ParameterName, "null")
End If
Next
CR.DataSourceConnections.Item(0).SetConnection(Configuration.ConfigurationSettings.AppSettings("Server").ToString(), Configuration.ConfigurationSettings.AppSettings("DatabaseName").ToString(), Configuration.ConfigurationSettings.AppSettings("UserName").ToString(), Configuration.ConfigurationSettings.AppSettings("Password").ToString())
Me.rv1.ReportSource = CR
Catch ex As Exception
End Try
End Sub
End Class
あなたの人々が問題を把握することができますが、任意のポインタが本当に理解されるだろうかわかりません。私は私がテストサーバーにも.netとcrystalをインストールしたことを確認することができます
また、テストサーバーとその正常に動作しているレポートで直接レポートを実行しようとしました。
--net 3.5 --Crystalレポート2008
おかげ