Generating line-graphs in Java for .xls files - java

Are there any libraries out there that can be used to generate line-graphs and export them to a .xls file?

Check out Apache POI (http://poi.apache.org/). However you need to use a limited workaround for this to work.
"You can not [sic] currently create charts. You can however create a chart in Excel, modify the chart data values using HSSF and write a new spreadsheet out. This is possible because POI attempts to keep existing records intact as far as possible." (http://poi.apache.org/spreadsheet/limitations.html)
You could also look into using the JExcelAPI (http://sourceforge.net/projects/jexcelapi/), but I have no familiarity with its limitations.

Related

Is there any way to extract charts from excel and convert them to image format using java?

I am working on an application that generates a xdoc output with a series of charts and tables, whose data comes from a given excel file. Currently I have been able to generate the necessary charts and tables managing the data with Apache Poi and generating the actual charts in a separate excel file using GCExcel, nevertheless, Apache does not include support to turn XSSFChart objecs into images in order to insert them into the document, and GCexcel's unlicensed version doesn't allow me to exoprt charts to images either. Anybody knows a way in which I can work around this issue?
Check out Spire.XLS library.
Download the free version here
Read what you can do using the library (features)
Official tutorial
Convert the excel file to image
I am not sure if this will actually work because I did not implement something like this before.

how to access blank cells from excel file using apache-tika

I am using Apache-Tika-1.13 to read and work with the excel file contents, I am working good with it but I have problem when I access excel file that contains blank cells. I need to access that blank cells, do Tika provides any way to access blank cells with it's latest release?
No. Apache Tika provides a consistent, easy to use and simplified view across a wide range of file formats. As such, not everything possible with the underlying libraries is possible with Tika.
You'll need to step down to Apache POI, the library that Tika uses for Excel files, if you want fine-grained control over blank and missing cells. Then, see the POI documentation on iterating over cells, including with missing/blank cell control for how to do what you want

Can Apache POI convert an Excel file to CSV without parsing?

Does anyone know if I can use something like Apache POI to convert an Excel file into CSV file in Java without application to parse into it?
Well, there needs to be some application, but you don't have to write it yourself.
I think there is no such ready-made tool included in POI itself, but other people have made such things and you can probably (disclaimer: I have not tried any) use them, for example
https://github.com/anjlab/excel2csv-java
http://code.google.com/p/excel2csv/
Note that this is bound to work only for very simple Excel files, as the Excel workbook format supports a lot of stuff that cannot be expressed in CSV.

How do I create form controls (radio, checkbox, buttons, etc.) in Excel using Apache POI (Java)?

Is it possible for me to produce form controls for Excel with Apache POI library using Java? If this is not possible, what are the alternative?
I really need this to accomplish my works.
Thank in advance.
For Excel 2007 or above, because Apache POI operates on OpenXML, you need to use VML Drawing. The fastest path to produce form controls is to do that manually, then open created xlsx or xlam as a zip archive and look at the /xl/drawings/vmldrawing.vml part. Then read about VML Drawing in OpenXML standard (ECMA-376) for basics on creating VML drawings. The approach is to create vmldrawing.vml part programmatically as regular XML container and fill it with XML code serialized from memory objects supported by Apache POI API appropriately.

Generate Dynamic Excel from Java

We've pre-defined Excel document structure with lots of formulas and macros written.
During download of Excel, thru Java application we populate certain cells in Excel with data. After download when user open Excel, macros & formulas embedded in it will read the pre-populated data and behave accordingly.
We are right now using ExtenXLS to generate Dynamic Excel document from Java. Licence is CPU based and it doesn't support Boxes with Dual core CPU. We are forced to buy more licence.
Is there any better tool we can look at it which is either free, product and support cost are minimal (Support is must), licence is simple?
I quite liked using the Apache POI Project HSSF library (http://poi.apache.org/) - it was fairly easy to use. I didn't use it in that much depth, but it seemed fairly powerful. Also, there's JExcelAPI (http://sourceforge.net/projects/jexcelapi/) which I've not used.
If your users will have a recent version of Excel, it isn't too hard to tweak the XML file format by hand. Just save an existing document as XML, and find the places you want to replace.
I work on an open source project called XLLoop - this framework allows you to expose POJO functions as Excel functions.
So, instead of populating the excel sheet with data you could create a function that downloaded the data and have it populate in place.

Categories