C# Crystal Report未加载,但显示错误消息
我正在使用SQL Server 2014在VS-2012中生成simple Crystal Report,不幸的是,它没有在浏览器中加载/显示内容。显示没有错误 我所做的是,添加了项目,添加了crystal report,并配置了SQL Server数据库,拖放项目,在visual studio中的预览正确显示为SQL Server中的数据。我没有添加任何额外的数据集或数据表,因为我直接从SQL server获取数据 这是密码C# Crystal Report未加载,但显示错误消息,c#,asp.net,sql-server,crystal-reports,C#,Asp.net,Sql Server,Crystal Reports,我正在使用SQL Server 2014在VS-2012中生成simple Crystal Report,不幸的是,它没有在浏览器中加载/显示内容。显示没有错误 我所做的是,添加了项目,添加了crystal report,并配置了SQL Server数据库,拖放项目,在visual studio中的预览正确显示为SQL Server中的数据。我没有添加任何额外的数据集或数据表,因为我直接从SQL server获取数据 这是密码 using System; using System.Collect
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Odbc;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
namespace CrystalReports
{
public partial class ShowReports : System.Web.UI.Page
{
//SqlConnection scon = new SqlConnection(ConfigurationManager.ConnectionStrings["DatabaseString"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CrystalReportViewer1.Visible = false;
//CrystalReportViewer1.RefreshReport();
}
}
protected void Button1_Click1(object sender, EventArgs e)
{
ReportDocument myReportDocument = new ReportDocument();
string reportPath = Server.MapPath(@"CrystalReport1.rpt");
myReportDocument.Load(reportPath);
string constring = ConfigurationManager.ConnectionStrings["DatabaseString"].ConnectionString;
SqlConnection con = new SqlConnection(constring);
string query = "SELECT * FROM tblCustomer";
con.Open();
SqlCommand cmd = new SqlCommand(query, con);
cmd.CommandType = CommandType.Text;
DataTable dt = new DataTable();
SqlDataAdapter adp = new SqlDataAdapter();
adp.SelectCommand = cmd;
adp.Fill(dt);
myReportDocument.SetDataSource(dt);
CrystalReportViewer1.ReportSource = myReportDocument;
CrystalReportViewer1.Visible = true;
}
}
}
那是一个公开的网站吗?如果是,请确保您正在发布aspnet_客户端文件夹,crystal运行时在哪里files@cojimarmiami不,未发布。是否有子报表?