This document discusses exporting data from a ListView control to a DIF file format. It introduces DIF as a text file format used to import and export single spreadsheets between different programs. It then provides C# and VB.NET code samples using the Spire.DataExport component to export the data from a ListView to a DIF file, specifying options like data formats and the file name.
1 of 2
Download to read offline
More Related Content
Listview to dif
1. Export Data from ListView to DIF
This article will show you how to export data from ListView to DIF
Introduction of DIF
DIF (Data Interchange Format) is a text file format used to import/export single spreadsheets
between spreadsheet programs (OpenOffice.org Calc, Excel, Gnumeric, StarCalc, Lotus 1-2-3,
FileMaker, dBase, Framework, Multiplan, etc.). It is also known as "Navy DIF". One limitation is
that DIF format cannot handle multiple spreadsheets in a single workbook.
How to Export Data from ListView to DIF
Spire.DataExport is a 100% pure .NET component suit for data exporting from Command,
ListView and DataTable into MS Excel,MS Word, HTML, XML, PDF, MS Access, DBF, SQL
Script, SYLK, DIF, CSV ,MS Clipboard format. Download Spire.DataExport and install with
.NET framework 2.0 (or above) together. Use the code below to export data from ListView to DIF.
ListView to DIF with C# Code
this.txtExport1.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView;
this.txtExport1.DataFormats.CultureName = "en-us";
this.txtExport1.DataFormats.Currency = "c";
this.txtExport1.DataFormats.DateTime = "yyyy-M-d H:mm";
this.txtExport1.DataFormats.Float = "g";
this.txtExport1.DataFormats.Integer = "g";
this.txtExport1.DataFormats.Time = "H:mm";
this.txtExport1.DataEncoding = Spire.DataExport.Common.EncodingType.ASCII;
this.txtExport1.DataSource = ExportSource.ListView;
this.txtExport1.ListView = this.ListView1
txtExport1.ExportType = TextExportType.DIF;
txtExport1.FileName = "sample.dif";
txtExport1.SaveToFile();
ListView to DIF with VB.NET Code
Me.txtExport1.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView
Me.txtExport1.DataFormats.CultureName = "en-us"
Me.txtExport1.DataFormats.Currency = "c"
Me.txtExport1.DataFormats.DateTime = "yyyy-M-d H:mm"
Me.txtExport1.DataFormats.Float = "g"
Me.txtExport1.DataFormats.Integer = "g"
Me.txtExport1.DataFormats.Time = "H:mm"
Me.txtExport1.DataEncoding = Spire.DataExport.Common.EncodingType.ASCII
Me.txtExport1.DataSource = Common.ExportSource.ListView
Me.txtExport1.ListView = Me.ListView1
2. txtExport1.ExportType = TextExportType.DIF
txtExport1.FileName = "sample.dif"
txtExport1.SaveToFile()
More about Spire.DataExport for .NET
Recommend:
Free Data Export Component
Spire.Office for .NET
Spire.Doc for .NET
Spire.XLS for .NET
Spire.PDF for .NET