can any give example on ("how to export excel and freeze panes in second row using asp.net c#")
how to export excel and freeze panes in second row using asp
Hi,
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Richard PorterPosted Feb 19, 2015, 6:16 AM
Now regarding the export, I'm not exactly sure what your requirement is here, nevertheless here is how you can export excel's data to a DataTable and here is how you can export excel file to ASP.NET's client:
Ring ZhongPosted Dec 30, 2013, 2:24 AM
<1>here is the demo for freeze panes in the second row:
using Spire.Xls;
using System.Drawing;
namespace FreezePane
{
class Program
{
static void Main(string[] args)
{
//Load File
Workbook workbook = new Workbook();
workbook.LoadFromFile
(@"E:\Work\Documents\ExcelFiles\PartSalesInfo.xlsx");
Worksheet sheet = workbook.Worksheets[0];
//Freeze the Second Row
sheet.FreezePanes(3, 1);
//Save and Launch
workbook.SaveToFile("FreezePane.xlsx", ExcelVersion.Version2010);
System.Diagnostics.Process.Start(workbook.FileName);
}
}
}
download spire.xls from here:
http://spreadsheet.codeplex.com/
<2>how to export excel?
do you mean export from datatable(database) to excel? if so
Demo here:
//export datatable to excel
Workbook book = new Workbook();
Worksheet sheet = book.Worksheets[0];
sheet.InsertDataTable(t, true, 1, 1);
book.SaveToFile("insertTableToExcel.xls");
for detailed info here:
http://www.e-iceblue.com/Knowledgebase/Spire.XLS/Program-Guide/Data-Export-/Import-Export-Datatable-to-Excel-from-Database.html
Also dataset to excel:
http://www.c-sharpcorner.com/uploadfile/babu_2082/export-dataset-to-excel/default.aspx