【发布时间】:2019-02-13 13:00:21
【问题描述】:
谁能告诉我如何通过查询字符串绑定 DevExpress XtraReport?
我只想在报告中显示 ID 值 8,我正在使用存储过程来获取数据。
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ConnectionString);
SqlCommand cmd = new SqlCommand("GetLabReport", connection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@PID", SqlDbType.Int).Value = Request.QueryString["ID"].ToString();
connection.Open();
SqlDataAdapter DA = new SqlDataAdapter(cmd);
DataTable DT = new DataTable();
XtraReport1 Rept = new XtraReport1();
string path = (Server.MapPath("App_Code/XtraReport1.cs"));
DA.Fill(DT);
connection.Close();
if(DT.Rows.Count>0)
{
}
以上内容适用于 Crystal Reports,但不适用于 DevExpress XtraReports。
【问题讨论】:
-
如果要将 xtrareport1 绑定到 DA 数据表,请将表分配给报表数据源“Rept.DataSource = DA”
标签: sql asp.net webforms devexpress xtrareport