Export Data from DataTable to Html, PDF, Excel and Word for .NET Without Automation

Discussion in 'Databases' started by kapa2323, Feb 17, 2011.

  1. #1
    DataExportWizard_Bin.zip - 390 KB

    DataExportWizard_Source.zip - 63 KB

    I’m a beginning programmer in C#. Recently I found a free .Net data export component, and by using this great component, I made a small data export tool which can easily export data from database to Html, PDF, Excel, Word, MS Access, Clipboard, XML, DBF, SQL Script, SYLK, DIF, Text and CSV.

    If we have a database-provider, the tool should support any database. Editing the App.config file can add other database providers. All installed providers that implement System.Data.Common.DbProviderFactory will be automatically filled in the Database-Provider list of the first step. Now, suppose we need export data from DataTable to Html. Instead of writing tons of code, only a few steps are enough if we use this small tool.

    Run this tool and do as the following steps:

    Step 1, Choose Database
    The 1st step is absolutely to choose a Database. This tool offers Odbc, OleDb, Oracle Client, SqlClient and Microsoft SQL Server Compact Data Provider for you to choose. Then, you need put the connection string to create a connection to the database.
    [​IMG]

    Step 2, Choose Data Source from your Database
    This tool enables users to choose Table, View and SQL Command. Choose the file you want to export data from. Here we choose Table to export data and save as Html.

    Data Source from Table:
    [​IMG]

    Step 3, Choose Columns
    The tool would show you all columns of the selected data file. If you don’t need export all of them you can only choose the columns which you need.
    [​IMG]

    Step 4, Choose Output File Format and Export

    Now you can choose a file format to save the exported data during Excel, Word, PDF, HTML, MS Access, Clipboard, XML, DBF, SQL Script, SYLK, DIF, Text and CSV. And here, you also can name your output file and choose the place to save. Select Html as the output file format.
    [​IMG]

    Is this tool great? Welcome any kind of suggestions to improve it!
    (Because the limits of attachment, I can’t upload the tool here. If any of you have interests to have a try, please leave you email address. I will send it to you ASAP! )

    If you want to make one by yourself, that free DataExport component may be useful for you. You can add database unlisted and set parameters at your will.

    Free DataExport Component Description
    Free DataExport Component Download
    (Note: Register before Download)
     
    kapa2323, Feb 17, 2011 IP
  2. kapa2323

    kapa2323 Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Step 5, Open Output Html File
    Check what we’ve done:
    [​IMG]

    If we choose PDF as output format:
    [​IMG]
     
    kapa2323, Feb 17, 2011 IP
  3. tomason

    tomason Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well done. It's very useful. Thank you.
     
    tomason, Feb 17, 2011 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    No sarcasm there at all!!
     
    AstarothSolutions, Feb 18, 2011 IP
  5. kapa2323

    kapa2323 Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Please download the tool and source here!
     
    kapa2323, Feb 22, 2011 IP
  6. prptl709

    prptl709 Guest

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    This is good example for exporting the database field.Thank you.
     
    prptl709, Feb 23, 2011 IP
  7. kapa2323

    kapa2323 Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
  8. kapa2323

    kapa2323 Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    kapa2323, May 3, 2011 IP