Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » General » Downloads
 
Add your own
alternative version

TblProc: OpenOffice Calc and Excel

, 29 Jan 2009
OpenOffice Calc and Excel
TblProc_demo.zip
TblProcBin
Interop.Excel.dll
Interop.Microsoft.Office.Core.dll
TblProc.dll
Test.exe
TblProc_src.zip
TblProcSrc
OO3.0_dlls
cli_basetypes.dll
cli_cppuhelper.dll
cli_oootypes.dll
cli_uno.dll
cli_ure.dll
cli_uretypes.dll
TblProc
Properties
TblProc.suo
Test
Properties
DataSources
DataClass.datasource
Settings.settings
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Test
{
    public partial class Form1 : Form
    {
        private List<DataClass> data = new List<DataClass>();
        private bool? useExcel = null;

        public Form1()
        {
            data.Add(new DataClass(0, "Bill", "you-know-yourselves", "IT-gangster ;-)", true));
            data.Add(new DataClass(1, "Alexander", "Pushkin", "Famous poet", false));
            data.Add(new DataClass(2, "Sid", "Vicious", "punk", false));
            data.Add(new DataClass(3, "Jello", "Biafra", "punk too", true));
            data.Add(new DataClass(4, "George W.", "Bush", "ex-US president", false));
            InitializeComponent();
            dataClassBindingSource.DataSource = data;
        }

        private void exportBtn_Click(object sender, EventArgs e)
        {
            try
            {
                Export exp = new Export(grid, "General export", useExcel);
                exp.Create();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception caught: " + ex.Message);
            }
        }

        private void createTest_Click(object sender, EventArgs e)
        {
            TestCreator tc = new TestCreator(useExcel);
            tc.Create();
        }

        private void SetTableProcessor(bool? excel)
        {
            useAutomaticToolStripMenuItem.Checked = (excel == null);
            useExcelToolStripMenuItem.Checked = (excel==true);
            useOpenOfficeorgToolStripMenuItem.Checked = (excel == false);
            useExcel = excel;
        }

        private void useExcelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SetTableProcessor(true);
        }

        private void useOpenOfficeorgToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SetTableProcessor(false);
        }

        private void useAutomaticToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SetTableProcessor(null);
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)

Share

About the Author

Aleksandr Sazonov
Software Developer (Senior)
Russian Federation Russian Federation
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.140821.2 | Last Updated 29 Jan 2009
Article Copyright 2007 by Aleksandr Sazonov
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid