本文介绍了使用C#创建报告excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我想用C#创建excel报告文件,我不知道如何使用C#创建excel文件并将数据显示到excel。我想根据订单ID创建月收入报告,并在记录的最后我想显示总金额和计数。 我的存储过程是 CREATE PROCEDURE Rpt_MonthlyIncome , @ Month INT , @ Year INT , @ FromAmount INT , @ ToAmount INT AS 选择 OrderID ,' Count' = Count(OrderID),' Total' = SUM(金额),' 月' = DATENAME(MONTH,OrderDate),' 年' = @年 来自 订单 其中年(OrderDate)= @ Year AND MONTH(OrderDate)= @ Month 和金额 BETWEEN @ FromAmount AND @ ToAmount 组 按订单ID ,DATENAME(MONTH,ReadingDate) 我尝试了什么: 我不知道如何创建excel文件Ť o显示数据,包括总金额和计数。解决方案 I want to create the excel report file with C# and I don't know how to create the excel file with C# and display the data to the excel. I want to create the monthly income report according to the order ID and in the end of the records I want to display the total amounts and counts.My Stored procedure isCREATEPROCEDURERpt_MonthlyIncome,@MonthINT,@YearINT,@FromAmountINT,@ToAmountINTASSelectOrderID,'Count'=Count(OrderID),'Total'=SUM(Amount),'Month' = DATENAME(MONTH,OrderDate),'Year' = @YearFromOrderWhereYEAR(OrderDate) = @YearANDMONTH(OrderDate) = @MonthAndAmount BETWEEN @FromAmount AND @ToAmountGroupbyOrderID,DATENAME(MONTH,ReadingDate)What I have tried:I don't know how to create excel file to display the data including total amounts and counts. 解决方案 这篇关于使用C#创建报告excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-23 21:18