Connecting to the external library from esProc

Follow the directions below to use reportliteCli external library files in esProc:

1. Configure jar files

Copy the following jars, which are located in the report’s class path (installation root directory\reportlite\lib), to esProc directory (installation root directory\esProc\ extlib\ReportLiteCli):

jboss-servlet-api_3.1-1.0.0.jar

esproc-ext-********.jar

htmlparser-1.6.jar

pdfbox-2.0.27.jar

fontbox-2.0.27.jar

graphics-box2.0.27.jar

mail-1.4.4.jar

reportlite.jar

scu-reportlite-cli-2.10.jar

Among them, scu-reportlite-cli-2.10.jar is the core jar of reportliteCli external library.

Note: The third-party jars below are also needed for using reportliteCli external library. They are already built into esProc and you do not need to configure them again.

batik-all-1.16.jar

commons-codec-1.15.jar

core-3.3.0.jar

poi-5.0.0.jar

poi-ooxml-5.0.0.jar

poi-ooxml-full-5.0.0.jar

poi-ooxml-lite-5.0.0.jar

Note: You can use the above necessary third-party jars as needed.

 

2. Configure xml file

Copy raqsoftConfig.xml located ininstallation root directory\reportlite\config and rename the file raqsoftConfigReportLite.xml (you can rename it as you like), where you need to configure the following nodes:

<Report>

<home> </home>  // Configure report main directory

<styleConfig> </styleConfig>  // Configure report layout

</Report>

Note:

<home> configures the report’s default storage directory; when importing a report through a relative path, the path is relative to the main directory configured here.

<styleConfig> configures report layout file’s path; it can be empty.

 

3. Configure data source

If the report to be imported uses a data source, you need to configure a namesake and same-structure data source in raqsoftConfigReportLite.xml. If the report does not use a data source, just skip this step.

<DB name="demo">

<property name="url" value="jdbc:hsqldb:hsql://127.0.0.1/demo" />

<property name="driver" value="org.hsqldb.jdbcDriver" />

<property name="type" value="13" />

<property name="user" value="sa" />

<property name="password" />

<property name="batchSize" value="1000" />

<property name="autoConnect" value="true" />

… …

</DB>

If you want to execute the spl file at command line, you need to configure autoConnect property value as true in xml file’s data source node, otherwise no data source can be found.

 

4. Configure external library directory on esProc designer

Select Tool-Options-Environmentthrough the menu bar and get into the following interface:

Click Browsebutton afterExternal library directoryto get into the interface below to choose an external library:

Click Browsebutton to choose the directory containing the target external library and thenOKbutton. The configuration takes effect only when you restart the IDE.

Note:

1) You can name the external library folder and select the external library path as you like. It would be better to avoid a directory having too many subdirectories in case that the loading is too slow and not to put jars for different external libraries in a same directory in case that unnecessary problems arise due to collisions between jar files.

2) When executing a spl file from the command line using the non-GUI interface, you can modify configuration fileinstallation root directory/esProc/config/raqsoftConfig.xml manually to add an external library directory:

<Esproc>

… …

// Configure external library folder path

<extLibsPath>F:\scudata\esProc\extlib</extLibsPath>

<importLibs>

// Configure external library folder’s name

<lib>ReportLiteCli</lib>

</importLibs>

</Esproc>

 

5. Import report file from esProc

A set of functions, such as reportlite_config(), reportlite_open() and reportlite_run(), can be used to import report files. See their uses through esProcHelp->Function reference.