标签:技术分享 sed 导入 warnings create mode lap length data
前提概要参考:http://www.cnblogs.com/liandy0906/p/7936524.html
DbContextBase db = new DbContextBase(); var list = db.PurchaseOrderTBs.ToList(); List<PurchaseOrderView> list2 = new List<PurchaseOrderView>(); foreach (var item in list) { list2.Add(new PurchaseOrderView() { OrderNo = item.OrderNo, PickNum = item.PickNum, ProductPrice = item.ProductPrice, ProductAmount = item.ProductPrice * item.PickNum }); } ReportDataSource ReportDataSource = new ReportDataSource(); ReportDataSource.Name = "DataSet1"; ReportDataSource.Value = list2; ReportViewer rvDoc = new ReportViewer(); rvDoc.LocalReport.ReportPath = Server.MapPath("~/Reports/Report2.rdlc"); rvDoc.LocalReport.DataSources.Add(ReportDataSource); #region 导入excel Warning[] warnings; string[] streamids; string mimeType; string encoding; string extension; byte[] bytes = rvDoc.LocalReport.Render( "Excel", null, out mimeType, out encoding, out extension, out streamids, out warnings); FileStream fs = new FileStream(@"c:\output.xls", FileMode.Create); fs.Write(bytes, 0, bytes.Length); fs.Close(); #endregion
标签:技术分享 sed 导入 warnings create mode lap length data
原文地址:http://www.cnblogs.com/liandy0906/p/7965894.html