当前位置:编程学习 > C#/ASP.NET >>

C# winform 报表 问题

 private void button1_Click(object sender, EventArgs e)
        {
            string strcnn = "Data Source=ST101;Initial Catalog=TEST; Integrated Security=SSPI";
            SqlConnection sqlcnn = new SqlConnection(strcnn);
            SqlCommand sqlcmd = new SqlCommand();
            SqlDataReader sqldr;
            DataSet ds = new DataSet1();
            sqlcnn.Open();
            sqlcmd.CommandType = CommandType.Text;
            sqlcmd.Connection = sqlcnn;
            sqlcmd.CommandText = "select * from userdata";

            sqldr = sqlcmd.ExecuteReader();
            ds.Tables["DataTable1"].Load(sqldr);
            ds.Tables.
            sqldr.Close();
            sqlcnn.Close();

            if (ds.Tables[0].Rows.Count == 0)
                MessageBox.Show("error");

            // reportViewer1.LocalReport.ReportPath = "E:\\VS2008\\print\\print\\Report1.rdlc";
            reportViewer1.LocalReport.ReportEmbeddedResource = "print.Report1.rdlc";
            ReportDataSource rds = new ReportDataSource();
            rds.Name = "DataSet1_DataTable1";
            rds.Value = ds.Tables[0];

            reportViewer1.LocalReport.DataSources.Add(rds);

            this.reportViewer1.RefreshReport();
        }


怎么就是不显示 detail 数据出来   --------------------编程问答-------------------- 去CSDN下載區找一個打印實例參考! --------------------编程问答-------------------- up --------------------编程问答-------------------- reportViewer1.LocalReport.Refresh()试试呢还有 ds.Tables.这是什么意思啊
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,