Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » excel export(excel export is creating formul from string)
excel export [message #1808871] Wed, 03 July 2019 15:37 Go to next message
Andreas Sturm is currently offline Andreas SturmFriend
Messages: 20
Registered: August 2018
Junior Member
I use the Snap #834 for the NatTable and use the export to excel functionality.
When a cell has a value similiar to: 1E04 and we export this to excel it is converted automatically to 10000.
We did not see a chance to intercept the export and set the format to text only.
Anybody having the same experience?
Re: excel export [message #1808879 is a reply to message #1808871] Wed, 03 July 2019 17:56 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Which exporter do you use?
Re: excel export [message #1809047 is a reply to message #1808879] Mon, 08 July 2019 05:58 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I did a small test and my assumption is that you are using the ExcelExporter which is registered via the DefaultExportBindings. If you use that, the result is not what you might expect, as it creates a simple XML format that is loaded in Excel.

For productive use I would recommend to use the HSSFExcelExporter from the NatTable POI Extension. This gives a lot more flexibility with regards to configuration and the result is more what you expect. A value 1E04 is exported as String if it is a String in that table. It will not be interpreted as a number by Excel then.

You can have a look at the _773_GridExcelExportFormatterExample to see how it needs to be registered.
https://github.com/eclipse/nebula.widgets.nattable/blob/master/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_700_AdditionalFunctions/_773_GridExcelExportFormatterExample.java
Re: excel export [message #1809206 is a reply to message #1809047] Thu, 11 July 2019 14:37 Go to previous messageGo to next message
Andreas Sturm is currently offline Andreas SturmFriend
Messages: 20
Registered: August 2018
Junior Member
Thank you for the small analysis. I had the time to have a look into our code. Your guess was correct, we are using

natTable.doCommand(new ExportCommand(natTable.getConfigRegistry(), natTable.getShell()));

I will have a look into your suggestion, using the POI Extensions.
Re: excel export [message #1809207 is a reply to message #1809206] Thu, 11 July 2019 14:47 Go to previous messageGo to next message
Andreas Sturm is currently offline Andreas SturmFriend
Messages: 20
Registered: August 2018
Junior Member
I checked your suggestion. We are using exactly, what is in the example. So it might be related to the ConfigRegistry, which is not set correctly for us, or not set at all.

[Updated on: Thu, 11 July 2019 14:48]

Report message to a moderator

Re: excel export [message #1810904 is a reply to message #1809207] Wed, 21 August 2019 14:15 Go to previous messageGo to next message
Andreas Sturm is currently offline Andreas SturmFriend
Messages: 20
Registered: August 2018
Junior Member
With the right configregistry set, the export to excel works, but only when starting our application form eclips dev environment.


Issue: Running our application with with eclipse 4.11 the functionality works i.e the excel sheet is successfully exported.
But when we export the jar files and deploy them in our application we get the below error in our logs

Caused by: java.lang.IncompatibleClassChangeError: Class org.apache.poi.hssf.usermodel.HSSFWorkbook does not implement the requested interface org.apache.poi.ss.usermodel.Workbook

Current Apache Poi jar file version is : org.apache.poi_3.12.0.jar
We tested the newly created jar files with new version of apache poi jar file poi-4.1.0.jar and poi-3.15.jar
Where it worked successfully.

But the above two jar files are missing the below package which is breaking our "Create PPT" functionality.
"org/apache/poi/xslf/usermodel/XMLSlideShow"


Strange fact. Our poi-3.12 file includes the xslf classes, but the downloaded ones do not.

Any idea?
Re: excel export [message #1810908 is a reply to message #1810904] Wed, 21 August 2019 15:06 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Is it possible that you have two different versions of apache poi in your runtime?
Re: excel export [message #1810944 is a reply to message #1810908] Thu, 22 August 2019 13:11 Go to previous messageGo to next message
Andreas Sturm is currently offline Andreas SturmFriend
Messages: 20
Registered: August 2018
Junior Member
In my runtime, there is only the org.apache.poi_3.12.0.jar. As described, our 3.12 as both HSSF and XSLF package. The downloaded .jar from apache is missingthe XSLF package. Our package is somehow legacy, with no knowlege about how it was created.
We checked, it does not connect online to search for missing packages.
Re: excel export [message #1810946 is a reply to message #1810944] Thu, 22 August 2019 13:49 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
If you mean the downloaded from eclipse Orbit, then IIRC we needed to leave them out because of some osgi related issues. But that was provided a long time ago. Not sure about the details anymore.
Previous Topic:Alternatives for Nattable
Next Topic:Wrong order after inserting a row into a NatTable
Goto Forum:
  


Current Time: Fri Mar 29 09:50:20 GMT 2024

Powered by FUDForum. Page generated in 0.02684 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top