随笔分类 -  office

通过ExchangeService 发送邮件
摘要:ExchangeService service = new ExchangeService(); service.Url = new Uri("https://***(host)/ews/exchange.asmx"); service.Credentials= new WebCredentials 阅读全文

posted @ 2018-02-03 11:41 lanyue52011 阅读(506) 评论(0) 推荐(0)

不引用office动态库导出excel
摘要:public class OutExcelReport { /// /// 把 DataSet 的数据导成 Excel /// /// 要导出的 DataSet /// 下载时客户端默认的文件名 /// true 标示第一行是列名,默认值为 true /// 报表统计结果 /// 报表物资类型 public static void DataSetToExcel(DataSet p_dsExport, string p_strFileName, bool p_... 阅读全文

posted @ 2013-10-16 16:34 lanyue52011 阅读(404) 评论(0) 推荐(0)

Aspose.Cells 导出 excel
摘要:Aspose.Cells.Workbook book = new Aspose.Cells.Workbook(); Aspose.Cells.Worksheet sheet = book.Worksheets["Sheet1"]; sheet.FreezePanes(1, 1, 1, 0); Aspose.Cells.Style style = book.Styles[book.Styles.Add()]; style.Pattern = Aspose.Cells.BackgroundType.Solid;... 阅读全文

posted @ 2013-10-16 16:22 lanyue52011 阅读(1458) 评论(0) 推荐(0)

C# 读取EXCEL文件出现数据丢失问题,数据不完整
摘要:将EXCEL数据导出的时候如果同一列数据中既有文字,又有数字!读取时一列中要么文字丢失只剩下数字,要么数字丢失,只剩下文字,这是由第一行的数据类型决定的。出现这种问题是由于数据类型不统一造成的。原来的连接字符串为:string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Path + "; Extended Properties=Excel 8.0;";查阅资料后问题解决:string strConn = "Provider=Microsoft.Jet.OLEDB.4. 阅读全文

posted @ 2013-08-28 07:57 lanyue52011 阅读(1284) 评论(0) 推荐(0)

COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.(转载)
摘要:Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.Example ApplicationThe problem is that by default Microsoft Excel as a COM object can only activated by the following accounts:AdministratorSystemInteractiveWh 阅读全文

posted @ 2012-09-13 08:23 lanyue52011 阅读(473) 评论(0) 推荐(0)

导航