Embed Excel in Java GUI - java

I'm looking for a way to embed an Excel spread sheet into a Java GUI application. Actually into a Qt GUI build by using QtJambi. The spread sheet does not necessarily be modifiable, but a seamless presentation would be preferable to an explicit opening of the excel application.
I came up with several ideas by scanning the web:
embed the sheet in an html file and display it by using a browser integrated in java
j-integra (seems old, requires licencing)
jacob (no gui support if I am correct)
use swt.ole classes (the most promising, there's even an example on the web, problem is how to display swt in qt)
use Qt's ActiveQt (not existent in the Java port)
Has anybody experiences concerning this topic? Any ideas that might be helpful - I would be grateful.
Regards

Related

DevExpress Charts for Java

I'm using DevExpress Web Development Charts for JavaScript charts.
I got a big surprise when I downloaded the trial for testing some basic implementation. It downloads an .exe file with a couple of samples implemented in .NET technology.
Well, for my project I must use Java/JSP. Is it possible to use the HTML5 charts of DevExpresswith Java? I've been looking in the downloaded files but it seems a bit complicated to extract only the js/HTML code related to the charts.
So, my question is: is it possible to use DevExpresscharts with JSP? If yes, where can I download the required libraries?

jidesoft pivotgrid

I want to use jidesoft's pivotgrid for my application.But I wonder if this component supports exporting excel,csv,pdf and printing utilities.I searced jidesoft website, but I didn't find anything.
Could anyone help experienced with this component?
Having looked at the feature list it obviously does not:
1, It would be advertised, because these features are business values that should be well advertised
2, It would be a complete misunderstanding of Swing component concept if such features would go into a Swing component. All it should give you is access to its underlying data model and a different component should deal with any data transformation.
You could make these transformations quite easily with Java libraries:
CSV: simple text file writing
Excel: it can read CSV, but if really needed go with Apache POI
PDF: iText is your best friend

Reports creation using Java

How can we create report in Java? Something like Crystal Reports in .net.
We have Jasper Report.
JasperReports is the world's most popular open source reporting engine. It is entirely written in Java and it is able to use data coming from any kind of data source and produce pixel-perfect documents that can be viewed, printed or exported in a variety of document formats including HTML, PDF, Excel, OpenOffice and Word.
Here is quick tutorial
Might be a duplicate of this question, BTW...
Anyways, here's my honest (yet biased) answer copied from there:
i-net Clear Reports (used to be i-net Crystal-Clear)
Simple and easy-to-use API of both the report engine and the Java report viewer.
Can export into any major format like PDF, HTML, SVG, XLS, etc., as well as into a Java applet viewer. (See samples)
Comes with a free and powerful graphical report template designer. (See video guide)
Installs as a WAR file on your application server or can be used as a library within your own application.
Great technical support (you usually get an answer in minutes or hours rather than days or weeks)
Charts based on JFreeChart (so includes Stock charts).
Can read Crystal Reports templates. (for a lot of customers, this is the killer feature since you don't have to re-create all your old Crystal Reports templates)
Great and competitive pricing - effectively costing "less than open source".
Free 90-day trial of the server component.
Free and fully functional report designer.
[full disclosure: Yes, I work for i-net software. But it's still my honest (though subjective and biased) answer to the question. ;)]
Try iRepor/JasperReports. I think is your best option as of today.
It's pretty mature, constantly updated (active), it supports StandAlone/Swing Applications, Web Applications, you can export to Excel/PDF, and integrates easily with major Appilcation Servers.
JasperReports is the Reporting Engine, and iReport is its IDE (Visual Report Editor).
BIRT is a very popular and powerful tool. Recommended.
Jasper report is indeed a powerfull tool, but sometimes to much work to create a report.
I would recommend to look also to POI and Docx4j. With those you can include a template with headers and entreprise style. You can build the file with simple statements but with Docx4j you can also replace tags (templating) in your .docx file by a element of choosing.
The docx4j(ava) documentation is available here: https://www.docx4java.org/forums/

Java libraries that work with Microsoft Office documents but do not depend on automation

By "not depend on automation", I mean that it should not require a Microsoft Office installation to work; let alone interact with a live instance of a Microsoft Office component. One such library is Aspose.Total for Java. Are there any more out there?
Another solution I'm considering is to use OpenOffice.org. However, I'm not sure if I'm going to run into the same problems as with Microsoft Office as detailed here.
For Office Documents: http://poi.apache.org/
I have not tried this myself, but Apache usually deliver good libraries
For just Excel: JExcel API for Java
I use this for one application, and it works quite well. May use a fair bit of RAM for larger documents.
One designed specifically to with with the newer XML formats is docx4j: http://dev.plutext.org/trac/docx4j
There are two further answers for this question. Depending on your application.
can borrow from the OpenOffice library code that deals with opening and saving MS Office files. (See: http://www.artofsolving.com/opensource/jodconverter or jOpenDocument )
You might just use OpenOffice itself by scripting or automating that.
I faced this question a while back with a Ruby app and because I was in control of the source document, I got the originator to save things as HTML format and used Tidy to filter the junk. Another option it to find a tool to convert the Office files to RTF which is more generic.
Another to consider ...
LibreOffice looks useful.
jExcelAPI if you just want excel.
Finally there are some opportunities on sourceForge, try this search: http://sourceforge.net/search/?q=java+ms+office
You may find spreadsheets BIG unless you use OpenOffice or MS Office because you need to have a fancy shamancy virtual sparse matrix to do what they do well.
ODF Toolkit - http://odftoolkit.org

Using excel as UI without VB

I think every business person would like to have excel UI, however they are forced into using web applications that sometimes look like really bad excel.
Are there any frameworks that help build excel ui without VB? I dont mean framework like POI or JExcel that allows you to generate excel reports.
I've seen many applications built using Excel. All of them were clumsy, error prone, and next to impossible to keep up-to-date.
If the end user needs an application to work like Excel for some grid calculations, then give them a tool to do so, or let them use Excel for that portion.
However using Excel / VBA exclusively to develop big Enterprise worthy applications is heading down the wrong road. It might work well for a while, but it won't be long before issues expose the weak points.
Since you ended talking about reports... yes, by all means have your application export to CSV, HTML, PDF, Excel etc. That way the user that wants to use Excel to generate pretty pie charts, and reformat/search/scan/crop the data can do so with the tool they feel comfortable with.
A combination of the two can work quite well... Excel is not great for inputting data, this is where an app (desktop or web) works better, but excel is great for dynamic reports and analyzing data.
The best approach for dynamic reports I've seen is to write add-ins that add new functions to excel (e.g. to pull in real time data). in the java space you could try XLLoop - this allows you to expose POJO functions in excel (full disclosure: I work on this project).
Obba is an Excel Add-In which allows to instantiate Java objects and work with them directly in Excel (without VBA or any other glue code).
The nice part is that it is fully transparent what the Excel Sheet (UI) does to your Java classes.
I am not sure what you mean by UI here, but if it is for the data presentation (as not data input) you could e.g use SQL Server Reporting Services and export the results to excel format. Alternatively you can parse your data into excel xml format and allow the user to open it as excel file (that is a bit painful though if your data is more complex than a simple table)
EDIT
I went through a pain of presenting and processing data with the use of excel when creating a web system that was replacing old paper work based one - that was a requirement for a transition time.
It is a real pain, all the data validation, ensuring that what is submitted back has not been modified structurewise etc.
My conclusion would be:
use the web system for inputing data
if required provide the excel format for reporting
if really, really required you could implement parsing excel into the web system for inputing data, but then add some human validation as it is humanly impossible to predict all the possible errors one can create in excel
You can look into embedding Excel as an ActiveX control into your application. It will allow you to manipulate the control from your language of choice.
This may point you in the right direction: http://j-integra.intrinsyc.com/support/kb/Article.aspx?id=30421
For java,this one is pretty good.
http://www.jxcell.net

Categories

Resources