Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Accessing POJO Data Source in a Plugin
FloridaFlo
Hello,
i have a report with a POJO data source. So i have a class called datasource which generates an arraylist with some data. The report gets the data via script. In Eclipse everything works fine. But as soon as i put all classes and reports together in a plugin and start it, the report cant find the datasource class. I think it is a path-problem.
In the report i passed the following code in the "open" part:
"count = 0;
pack = Packages.bi_reporting.plugin;
data = pack.DataSource();
list = data.getData();
size = data.getSize();"
This is the code in the "fetch" part:
"if(count < size ){
selrow = list.get(count);
count++;
row["Spalte1"] = selrow[0];
row["Spalte2"] = selrow[1];
row["Spalte3"] = selrow[2];
return true;
}
return false;"
Is there a way to fix this?
Thanks,
Florian
Find more posts tagged with
Comments
Virgil Dodson
Hi Florian,
Are you using the BIRT viewer, or just the Engine APIs to deploy your BIRT reports.
If you are using the viewer, then your classes go where it is defined in the web.xml for BIRT_VIEWER_SCRIPTLIB_DIR. This is typically set to RUNTIME_HOME/birt/scriptlib.
If you are using the Engine APIs, then you can add your JAR'd up classes to RUNTIME_HOME/lib ... or you can add your JARs using one of the following
EngineConstants.WEBAPP_CLASSPATH_KEY = "webapplication.projectclasspath"
EngineConstants.WORKSPACE_CLASSPATH_KEY = "workspace.projectclasspath"
EngineConstants.PROJECT_CLASSPATH_KEY = "user.projectclasspath"
i.e. EngineConfig config = new EngineConfig();
config.setProperty(EngineConstants.WEBAPP_CLASSPATH_KEY, "c:tempeh.jar;c:javameh.jar");
FloridaFlo
Hi Virgil,
thanks for your reply.
I was first using only the engine but implemented the viewer now.
I will try is with your code.
Regards
Florian