XLS (Excel) to DBF Converter

Buy Now! Free Download
...
AllWindowsiOS,OSXOther

Products
CDBF - DBF Viewer and Editor
DBF Viewer/Editor for iOS
DBF reanimator
CDBFlite
CDBFAPI
Excel Library
DBF Script
CSV to DBF Converter
CSV to DBF Converter for Mac
CSV to XLS Converter
CSV to XLS Converter for Mac
CSV to SQLite Converter for Mac
¤ XLS to DBF Converter
XLS to DBF Converter for Mac
XLS to CSV Converter
XLS to CSV Converter for Mac
XLS to JSON Converter
DBF to CSV Converter
DBF to CSV Converter for Mac
DBF to JSON Converter
DBF to XLS Converter
DBF to XLS Converter for Mac
DBF to MDB Converter
DBF to SQL Converter
DBF to SQL Converter for Mac
DBF to SQLite Converter for Mac
DBF to XML Converter
DBF to XML Converter for Mac
DBF to DBF Converter
DBF to DBF Converter for Mac
DBF to HTML Converter
MDB to DBF Converter
MDB to XLS Converter
MDB to CSV Converter
DBF to PDB Converter
PDB to DBF Converter

xls2dbfAPI example

We provide API which you can use from your own application to convert your data from one format to another.

You have to prepare an array with parameters and pass it to the StartConversion function. The list of parameters.

int StartConversion(string[] parameters);

returns 1 if there were not problems and conversion has started;
returns 0 if something wrong with parameters. Additional info you can get in conversionDidFail.

void CancelConversion();

It allows you to break the conversion. API closes all opened files and stops.

delegate void ConversionDidFail(int code);

The function is called if there was some problem with input parameters:

  • 10 - Input or output files are not defined
  • 20 - Internal exception in the conversion cycle
  • 30 - Cannot open a source file
  • 40 - Cannot overwrite an output file
  • 50 - Cannot open an output file
  • 60 - Cannot save an output file

delegate void ConversionProgress(int percent);

This function provides information about the convertion progress. You can also cancel the process here by calling CancelConversion();

delegate void ConversionComplete(string[] outputFiles);

This function is called after conversion and returns a list of output files.


        private void button_Click(object sender, EventArgs e)
        {
            List<string> args = new List<string>();

            args.Add("d:\\source\\source.xls");
            args.Add("-output=d:\\target\\target.dbf");
            args.Add("-separate=0");
            //args.Add("-one more parameter");
            args.Add("-key=YOUR_REGISTRATION_CODE");

            xls2dbfAPI dll = new xls2dbfAPI();

            dll.conversionDidFail += new xls2dbfAPI.ConversionDidFail(
                delegate(int code)
                {
                    MessageBox.Show("Return code " + code.ToString());
                }
            );

            dll.conversionProgress += new xls2dbfAPI.ConversionProgress(
                delegate(int percent)
                {
                    progressBar1.Value = percent;
                    //if (condition)
                    //    dll.CancelConversion();
                }
            );

            dll.conversionComplete += new xls2dbfAPI.ConversionComplete(
                delegate(string[] outputFiles)
                {
                    foreach (String s in outputFiles)
                    {
                        MessageBox.Show(s);
                    }
                }
            );

            dll.StartConversion(args.ToArray());
        }


Related Links
Command line
Using API
XLS to DBF Converter for Mac
XLS to DBF Converter (old version)

Copyright © WhiteTown Software, 1996-2017 | Privacy policy | Site map