cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to export to excel file using Program Objects with BO SDK

0 Kudos

I am trying to run a Program Object in BO CMC using a schedule to create a excel report. I am using the some of the BO SDK libraries and Apache Poi Library to export to excel.

Whenever I run the Program Object in CMC, it runs successfully but I dont get the excel file generated.

Rather I get the following error.

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/xssf/usermodel/XSSFWorkbook
    at com.sap.sdk.Main.run(Main.java:60)
    at com.crystaldecisions.sdk.plugin.desktop.program.internal.ProgramWrapper.main(ProgramWrapper.java:174)
Caused by: java.lang.ClassNotFoundException: org.apache.poi.xssf.usermodel.XSSFWorkbook
    at java.net.URLClassLoader.findClass(URLClassLoader.java:444)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:490)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:376)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    ... 2 more<br>

I can see the apache poi library is present in the libs folder of BO. Is there something I am missing out?

Accepted Solutions (0)

Answers (1)

Answers (1)

DellSC
Active Contributor
0 Kudos

What are you trying to export to Excel? If it's a report, most types of reports have the ability to export to Excel included. If it's other data from your system, I generally find it's much easier to export to .csv file, which can be opened in Excel, because you just have to work with text files using java.io.

-Dell

0 Kudos

It is other data from the BO System, the reason I was trying to use Excel is to have multiple sheets within a single file to organize the data. As you mentioned CSV is easier and works fine.

Any idea for Excel?

DellSC
Active Contributor
0 Kudos

You might try building a .bat file to run the program and publish that to BOBJ instead of the program. I have done this successfully in the past.

Here's what I do:

1. I work in Eclipse, so when I compile the .jar file, I tell it to put the library files in a folder "next to" the .jar.

2. The contents of the .bat file look like this:

@Echo On
cd <folder where the .jar file is located>
java.exe -Xmx1G -jar <.jar file> Administrator <admin pw> <cms name> secEnterprise <any other parameters>
pause

3. I put the "@Echo On" and "pause" in there when I'm initially testing outside of BOBJ so that I can see what's happening if there are issues. I take them out before publishing it. You can also add a java build path statement before calling java.jar to add the location of the Apache Pol library and it's dependencies if it's not in the folder next to the .jar file.

4. In the Application section of the CMC, go to the "Program Object Properties" properties of the Central Management Console app and turn on "Run scripts/binaries". You won't be able to publish the .bat file unless this is checked.

5. Publish the .bat file to the BI Platform and schedule it.

-Dell

0 Kudos

Will try that. Should the location of the.jar file and associated libraries must be placed in the BO server or it can be in the local computer?

DellSC
Active Contributor
0 Kudos

It should be on the BO Server. Or it could be in a shared folder that the service account that runs the SIA has access to. However, I've sometimes had problems with the .jar taking much longer to run when it's on a share than when it's local on the server. If you have multiple servers in a cluster, you do one of these:

1. Copy the .jar and its accompanying files to the same folder on each of the servers in the cluster that have a Program Job Server Service running. Use the drive and folder name in the .bat file.

2. Copy the files to a single server. Set up a server group for that server. When you publish the .bat file, set it to only run on the server group for that server. Use the drive and folder name in the .bat file.

3. Put the files on a share. Use the UNC path in the .bat file.

-Dell