araz_pashazadeh
یک شنبه 19 بهمن 1393, 12:43 عصر
با سلام
دوستان لطفا بگین مشکل تیکه کد زیر چیه که اطلاعات را در کریستال نمایش نمیده؟
البته داده را درست میخواند فقط نمایش نمیده
protected void Page_Load(object sender, EventArgs e) {
try
{
if (!IsPostBack)
{
CrystalReportViewer1.RefreshReport();
}
}
catch { }
}
private void Page_Init(object sender, EventArgs e)
{
ConfigureCrystalReports();
}
private ReportDocument customerReport;
private void ConfigureCrystalReports()
{
customerReport = new ReportDocument();
string reportPath = Server.MapPath("MenuReport.rpt");
customerReport.Load(reportPath);
string constring = ConfigurationManager.ConnectionStrings["SHOPCMSConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(constring);
con.Open();
SqlCommand cmd = new SqlCommand("SELECT [Id] ,[Url] [Title] ,[ParentId] ,[Active] FROM [Tbl_Menu]", con);
// cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandType = CommandType.Text;
DataTable dt = new DataTable();
SqlDataAdapter adp = new SqlDataAdapter();
adp.SelectCommand = cmd;
adp.Fill(dt);
customerReport.SetDataSource(dt);
CrystalReportViewer1.ReportSource = customerReport;
CrystalReportViewer1.DataBind();
}
لطفا راهنمایی کنین
دوستان لطفا بگین مشکل تیکه کد زیر چیه که اطلاعات را در کریستال نمایش نمیده؟
البته داده را درست میخواند فقط نمایش نمیده
protected void Page_Load(object sender, EventArgs e) {
try
{
if (!IsPostBack)
{
CrystalReportViewer1.RefreshReport();
}
}
catch { }
}
private void Page_Init(object sender, EventArgs e)
{
ConfigureCrystalReports();
}
private ReportDocument customerReport;
private void ConfigureCrystalReports()
{
customerReport = new ReportDocument();
string reportPath = Server.MapPath("MenuReport.rpt");
customerReport.Load(reportPath);
string constring = ConfigurationManager.ConnectionStrings["SHOPCMSConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(constring);
con.Open();
SqlCommand cmd = new SqlCommand("SELECT [Id] ,[Url] [Title] ,[ParentId] ,[Active] FROM [Tbl_Menu]", con);
// cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandType = CommandType.Text;
DataTable dt = new DataTable();
SqlDataAdapter adp = new SqlDataAdapter();
adp.SelectCommand = cmd;
adp.Fill(dt);
customerReport.SetDataSource(dt);
CrystalReportViewer1.ReportSource = customerReport;
CrystalReportViewer1.DataBind();
}
لطفا راهنمایی کنین