Import and use POI Java

hi, how can i import and use POI library to work with excel files ?

Since you’re asking in 3rd party modules, I assume you want to do this as part of a module you’re writing, as opposed to doing this in a script. You would add the dependency like any other dependency – you can copy/paste from Maven Central.

If you will ever be using the reporting module with your module, please note that module uses version 3.14 of Apache POI. Using another version in your module could cause conflicts.

Actually I set the wrong category :sweat_smile: ( now is set correctly )
What I wish to achive is to import the POI library inside Igniton and use it for a script inside a button.
I tried to import it inside C:\Program Files\Inductive Automation\Ignition\lib\core\gateway but with no success.
Can you help me out?

Consider using one of the existing modules that embed the Apache POI libraries, like Kymera’s Office Document Module.

1 Like

Hi @pturmel, How do we use latest version if we attend to?

My advice no longer applies, as Ignition now has the Apache POI libraries in the base platform. No additional module required. You should search this forum for examples.

2 Likes

Yes, I saw them on core lib folder, I'd like to use latest version instead of old ones in my custmized module, how do we force to use latest version though?

You won’t be able to do that, ClassLoaders delegate to parent first, you’re always going to load the older, provided version instead.

You might be able to replace the JARs included with Ignition but there’s no guarantee it won’t break something.

Do you mean replacing old JARs with the same names but conents are latest?
It's going to be covered once we reinstall...

You can delete the old JARs and just put the new ones in. The names of the JAR files in the lib/core/* folders aren't important.

Yes, that's why the names aren't important. They get deleted and replaced on upgrade, so you'd have to replace them every time you upgraded.

Unfortunately the easiest solution here is to change your module to use the same version POI that Ignition does.

1 Like