Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Export data from listview to excel
1. How to Export Data from Listview to Excel with C#/VB.NET<br />Spire.DataExport, as a 100% pure .NET component suit for data exporting from SQL Command, Listview and DataTable into MS Excel,MS Word, HTML, XML, PDF, MS Access, DBF, SQL Script, SYLK, DIF, CSV ,MS Clipboard format, quickly and easily! Here we will introduce how to export data from Listview to Excel with C#/VB.NET.<br />As an electronic spreadsheet program, MS Excel owns a lot of advantages such as it can be used for storing, organizing and manipulating data. Over several decades, Microsoft has updated, expanded and tweaked Excel to keep up with both modern technology and the needs of spreadsheet users. MS Excel has been the most popular data organizing program. So we may usually need export data from database into Excel, such as from ListView. <br />How to Export Data from Listview to Excel with C#/VB.NET?<br />Spire.DataExport presents an easy way to export data from Listview to Excel. And it offers both C# and VB.Net language to realize it. <br />Download Spire.DataExport (or Spire.Office) with .NET framework together and use the code below to export data from Listview to Excel with C#/VB.NET.<br />C# Listview to Excel<br />this.cellExport1.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView;<br />this.cellExport1.AutoFitColWidth = true;<br /> this.cellExport1.DataFormats.CultureName = quot;
en-usquot;
;<br />this.cellExport1.DataFormats.Currency = quot;
?#,###,##0.00quot;
;<br />this.cellExport1.DataFormats.DateTime = quot;
yyyy-M-d H:mmquot;
;<br />this.cellExport1.DataFormats.Float = quot;
#,###,##0.00quot;
;<br />this.cellExport1.DataFormats.Integer = quot;
#,###,##0quot;
;<br />this.cellExport1.DataFormats.Time = quot;
H:mmquot;
;<br />this.cellExport1.FileName = quot;
sample.xlsquot;
;<br />this.cellExport1.SheetOptions.AggregateFormat.Font.Name = quot;
Arialquot;
;<br />this.cellExport1.SheetOptions.CustomDataFormat.Font.Name = quot;
Arialquot;
;<br />this.cellExport1.SheetOptions.DefaultFont.Name = quot;
Arialquot;
;<br />this.cellExport1.SheetOptions.FooterFormat.Font.Name = quot;
Arialquot;
;<br />this.cellExport1.SheetOptions.HeaderFormat.Font.Name = quot;
Arialquot;
;<br />this.cellExport1.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue;<br />this.cellExport1.SheetOptions.HyperlinkFormat.Font.Name = quot;
Arialquot;
;<br />this.cellExport1.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single;<br />this.cellExport1.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left;<br />this.cellExport1.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top;<br />this.cellExport1.SheetOptions.NoteFormat.Font.Bold = true;<br />this.cellExport1.SheetOptions.NoteFormat.Font.Name = quot;
Tahomaquot;
;<br />this.cellExport1.SheetOptions.NoteFormat.Font.Size = 8F;<br />this.cellExport1.SheetOptions.TitlesFormat.Font.Bold = true;<br />this.cellExport1.SheetOptions.TitlesFormat.Font.Name = quot;
Arialquot;
;<br /> this.cellExport1.DataSource = ExportSource.ListView;<br /> this.cellExport1.ListView = this.ListView1;<br />cellExport1.SaveToFile();<br />ListView to Excel with VB.NET Code<br />VB.NET Listview to Excel:<br />Me.cellExport1.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView<br /> Me.cellExport1.AutoFitColWidth = True<br /> Me.cellExport1.DataFormats.CultureName = quot;
en-usquot;
<br /> Me.cellExport1.DataFormats.Currency = quot;
?#,###,##0.00quot;
<br /> Me.cellExport1.DataFormats.DateTime = quot;
yyyy-M-d H:mmquot;
<br /> Me.cellExport1.DataFormats.Float = quot;
#,###,##0.00quot;
<br /> Me.cellExport1.DataFormats.Integer = quot;
#,###,##0quot;
<br /> Me.cellExport1.DataFormats.Time = quot;
H:mmquot;
<br /> Me.cellExport1.FileName = quot;
sample.xlsquot;
<br /> Me.cellExport1.SheetOptions.AggregateFormat.Font.Name = quot;
Arialquot;
<br /> Me.cellExport1.SheetOptions.CustomDataFormat.Font.Name = quot;
Arialquot;
<br /> Me.cellExport1.SheetOptions.DefaultFont.Name = quot;
Arialquot;
<br /> Me.cellExport1.SheetOptions.FooterFormat.Font.Name = quot;
Arialquot;
<br /> Me.cellExport1.SheetOptions.HeaderFormat.Font.Name = quot;
Arialquot;
<br /> Me.cellExport1.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue<br /> Me.cellExport1.SheetOptions.HyperlinkFormat.Font.Name = quot;
Arialquot;
<br /> Me.cellExport1.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single<br /> Me.cellExport1.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left<br /> Me.cellExport1.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top<br /> Me.cellExport1.SheetOptions.NoteFormat.Font.Bold = True<br /> Me.cellExport1.SheetOptions.NoteFormat.Font.Name = quot;
Tahomaquot;
<br /> Me.cellExport1.SheetOptions.NoteFormat.Font.Size = 8.0!<br /> Me.cellExport1.SheetOptions.TitlesFormat.Font.Bold = True<br /> Me.cellExport1.SheetOptions.TitlesFormat.Font.Name = quot;
Arialquot;
<br /> Me.cellExport1.DataSource = Common.ExportSource.ListView<br /> Me.cellExport1.ListView = Me.ListView1<br /> cellExport1.SaveToFile()<br />More about Spire.DataExport<br />Download Spire.DataExport<br />Purchase Spire.DataExport<br />