C # import and export with the latest version of WPS implementation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.