Microsoft's Excel operation I believe you also know, inconvenient, installation package is too large, and the table data volume is only more than 6,000 (is more than 6,000 or more than 60,000 I forget), in the export of large amounts of data can not be done, and the WSP table has realized the capacity of millions of data, and the installation package is small, More convenient to operate. The following uses the most wps2015 implementation of a simple import to out, reference Http://blog.163.com/[email protected]/blog/static/410470052013818325357/article, You can also refer to WSP Two development document http://www.wps.cn/wpsapi/funcapilist/page-1.htm, corresponding DLL references such as:
Using system;using system.collections.generic;using system.linq;using system.web;using System.Web.UI;using system.web.ui.webcontrols;using excel;namespace webapplication1{public partial class WebForm1:System.Web.UI.Page {protected void Page_Load (object sender, EventArgs e) {excel.application appli = new Applicatio N (); /*WSP Excel Export *//*excel._workbook wk = appli. Workbooks.Add (Type.Missing); Excel.Worksheet sheet = wk. ActiveSheet; Sheet. Cells[1, 1] = "wps form Test"; Wk. SaveAs (Server.MapPath ("/2.xls"), Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Xlsaveasaccessmode.xlexclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); Wk. Close (Type.Missing, Type.Missing, Type.Missing); System.Runtime.InteropServices.Marshal.ReleaseComObject (wk); System.Runtime.InteropServices.Marshal.ReleaseComObject (appli); *//*wps Excel GuideEnter */excel._workbook wk = appli. Workbooks.Open (Server.MapPath ("/2.xls")); Excel.Worksheet sheet = wk. Worksheets.get_item (1); Excel.Range Range = sheet. UsedRange; String data = ((Excel.Range) Range.get_item (1, 1)). Text; Response.Write (data); } }}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
C # import and export with the latest version of WPS implementation