Sahi OpenSource to store data from web application and to open office - openoffice-calc

I am new to automation. I am trying to fetch data from an application and store it in excel format. It can be done using Ms Excel but can the same be done by using Open Office?
I am using Sahi OpenSource

When you are storing a data in some excel file, it doesn't matters whether you store it from Ms Excel or open office. You have the excel or csv file to which Sahi will write directly. You can write to excel files or csv files or text file even from Sahi. I would encourage you to look at sahi documentation regarding writing to files.

Related

How do you convert hdf5 files into a format that is readable by SAS Enterprise Miner(sas7bdat)

I have a subset of the data set called as 'million song dataset' available on the website (http://labrosa.ee.columbia.edu/millionsong/) on which I would like to perform data mining operations on SAS Enterprise Miner (13.2).
The subset I have downloaded contains 10,000 files and they are all in HDF5 format.
How do you convert hdf5 files into a format that is readable by SAS Enterprise Miner(sas7bdat)
On Windows there is an ODBC driver for HD5. If you have SAS/ACCESS ODBC then you can use that to read the file.
I don't think it's feasible to do this directly, as hdf5 seems to be a binary file format. You might be able to use another application to convert hdf5 to a plain text format and then write SAS code to import that.
I think some of the other files on this page might be easier to import:
http://labrosa.ee.columbia.edu/millionsong/pages/getting-dataset

converting a large number of excel files into a single mysql table

I am using microsoft visual studio 10 c++ and mysql workbench.I have a large number of excel files and i want to update the content of all excel files into a single mysql table.I can create a csv file for each excel file and then import it but i want it to be done with the help of a stored procedure.I want to use c++.And this procedure has to be repeated with different excel files.
i was thinking of connecting my c++ program to both excel and mysql simultaneously(is it possible?) and reading the excel files and adding the data into the mysql table.
i have already connected my program to mysql database.
Any other approach would be appreciated.
In MySQL Store Procedure it will not accept bulk load or CSV import But You can use without SP. Better Try to import using C++.

Reading the cells of an excel sheet in c++

In one of my program, I'm suppose to parse an excel sheet using C++ programming. I'm not suppose to use any third party tool. So, please let me know the code to parse excel sheet and read rows and columns of an selected excel sheet. Thanks in advance.
In order to read excel files you need some external tool like MS - Office Library. Why don't you export excel to CSV (Comma Seperated File) File->Save as->CSV(Comma Delimited).
Then you can read it just like normal txt file. You can open and edit just like worksheet in MS-Excel.
You can COM to access Excel; for an example, see http://www.wilmott.com/messageview.cfm?catid=10&threadid=26137 (from this question)
However to will probably be easier to use C++/CLI as a wrapper and access COM from .NET.

Programmatically creating Excel file in C++

I have seen programs exporting to Excel in two different ways.
Opening Excel and entering data cell by cell (while it is running it looks like a macro at work)
Creating an Excel file on disk and writing the data to the file (like the Export feature in MS Access)
Number 1 is terribly slow and to me it is just plain aweful.
Number 2 is what I need to do. I'm guessing I need some sort of SDK so that I can create Excel files in C++.
Do I need different SDKs for .xls and .xlsx?
Where do I obtain these? (I've tried Googling it but the SDKs I've found looks like they do other things than providing an interface to create Excel files).
When it comes to the runtime, is MS Office a requirement on the PC that needs to create Excel files or do you get a redistributable DLL that you can deploy with your executable?
You can easily do that by means of the XML Excel format. Check the wikipedia about that:
http://en.wikipedia.org/wiki/Microsoft_Excel#XML_Spreadsheet
This format was introduced in Excel 2002, and it is an easy way to generate a XLS file.
You can also try working with XLS/XLSX files over ODBC or ADO drivers just like databases with a limited usage. You can use some templates if you need formatting or create the files from stratch. Of course you are limited by playing with the field values that way. For styling etc. you will need to use an Excel API like Microsoft's.
I'm doing this via Wt library's WTemplate
In short, I created the excel document I wanted in open office, and save-as excel 2003 (.xml) format.
I then loaded that in google-chrome to make it look pretty and copied it to the clipboard.
Now I'm painstakingly breaking it out into templates so that Wt can render a new file each time.

Prgrammably making excel spreadsheets (97 - 2003 format)

I was wondering how difficult it would be to make an application like this. Basically, I have some old html files that use tables. I want to put these tables into excel for easier reading and manipulation. I only have text, I have no numbers of formulas or anything.
Are there any tutorials on how to do this sort of thing?
The application would produce .xls
Thanks
You have three options:
Output a CSV file. While not an XLS file, Excel is more than capable of opening such a file, and it's extremely easy to create. You need nothing more than standard C++ to implement this solution. This is by far the easiest and quickest way to output to Excel (or any spreadsheet program, for that matter).
Use OLE automation. Microsoft even has a Knowledge Base article that provides an example of how to invoke Excel from your native C++ application and fill in some values. If you absolutely need to output XLS files, this is the easiest way to go. Note that users must have Excel installed on their computers for this to work.
Create your own XLS writer. Don't even bother with this option unless you really want to generate XLS files without requiring Excel to be installed on end-user computers. Options 1 and 2 are more than good enough for just about any application.
You don't need to reverse-engineer the XLS format; Microsoft documents the excel file format here. Due to the evolution of Excel over the years, it's not exactly a clean specification.
If you don't mind installing a copy of Excel along with your program, using OLE Automation would be much easier.
The simplest thing to do is simply create a CSV file. If you have column headers, put them in the first row. CSV files can be opened natively in Excel as if they were Excel spreadsheets.
There is a trick here: save .html tables with the .xls extension and Excel can read them (ie Excel can read the output of the DataGrid control).
But, if you want to create 'real' Excel files, then you can either use Excel Interop (which could be messy, requires Excel and the PIA's to be installed on the machine, and needs careful memory management (since its COM)). You could also opt for a 3rd-party library like FlexCel - which will avoid many of the InterOp problems but will not give you 'complete' Excel functionality (addins, custom vba macros etc.). For most uses, however, a 3rd party library should do the trick.
Looks like there's another alternative called ExcelFormat. I didn't try it, though.