如何在asp.net C#

时间:2017-10-25 13:28:44

标签: c# asp.net visual-studio crystal-reports rdlc

我想在ASP.NET C#中制作这种报告。我已经尝试过使用RDLC和Crystal Report,但是有一些专栏可供选择。所以我没有找到任何方法来填补列。谁能帮我制作这种报告呢? [Image preview]

我已经创建了一个行组,但是它位于表的开头,在表的末尾,行组不可行 [Image preview]

ReportViewer1.Reset();

//Data Source
DataTable dt = GetData();
ReportDataSource rds = new ReportDataSource("DataSet1", dt);
ReportViewer1.LocalReport.DataSources.Add(rds);

//Path
ReportViewer1.LocalReport.ReportPath = "Report3.rdlc";

//Refresh
ReportViewer1.LocalReport.Refresh();


private DataTable GetData()
{
    DataTable dt = new DataTable();
    string connStr = @"Data Source= OVI-PC\SQLEXPRESS; Database =RdlcDB; Integrated Security= true;";
    using (SqlConnection cn = new SqlConnection(connStr))
    {
        SqlCommand cmd = new SqlCommand("SELECT  CustomerID ,CompanyName,ContactName,ContactTitle,Address,City,Country,Phone FROM Customers",cn);
        cn.Open();
        SqlDataReader reader = cmd.ExecuteReader();
        dt.Load(reader);
    }

    return dt;
}

1 个答案:

答案 0 :(得分:2)

rdlc设计中的

enter image description here你可以在最后设置群组,请看这个链接: grouping in rdlc