清高手指点!!
报表运行时报错!
Server Error in '/WebApplication1' Application.
--------------------------------------------------------------------------------
文件 C:\DOCUME~1\SYLX\ASPNET\LOCALS~1\Temp\temp_d78dc583-0fa0-4aee-9a36-f6c0bb822fcb.rpt 内出错:无效组条件。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalReports.Engine.InvalidArgumentException: 文件 C:\DOCUME~1\SYLX\ASPNET\LOCALS~1\Temp\temp_d78dc583-0fa0-4aee-9a36-f6c0bb822fcb.rpt 内出错:无效组条件。
Source Error:
源文件:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace WebApplication1
{
/// <summary>
/// QueryReport 的摘要说明。
/// </summary>
public class QueryReport : System.Web.UI.Page
{
protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
public CrystalReport1 myrpt=null;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
DataSet1 myset=new DataSet1();
string conn="server=localhost;uid=sa;pwd=;database=Northwind";
string sqlstr="select * from Suppliers";
SqlConnection sqlconn=new SqlConnection(conn);
SqlDataAdapter myadapter=new SqlDataAdapter(sqlstr,conn);
myadapter.Fill(myset,"Suppliers");
CrystalReport1 myrpt=new CrystalReport1();
myrpt.SetDataSource(myset);
CrystalReportViewer1.ReportSource=myrpt;
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}