How can I get the parameter datatypes from a Report Definition/Design [message #1044165] |
Thu, 18 April 2013 11:06  |
Eclipse User |
|
|
|
I've been working with BIRT to provide reporting capability in a Eclipse Scout project.
As part of the requirements, I've constructed the functionality where users can produce reports based upon their own input (limited by the parameters given by the system).
In order to get the parameters of the Report in question, I run the createGetParameterDefinitionTask() function on the engine to get a list of ScalarParameterDefn's. From which I then pluck things like the parameter defaultvalue, name and datatype.
Relevant function shown here:
private List<ReportParameter> _getReportParameters(IReportRunnable design, ReportEngine engine)
{
List<ReportParameter> reportParameterList = new ArrayList<ReportParameter>();
IGetParameterDefinitionTask parameterDefinitionTask = engine.createGetParameterDefinitionTask(design);
Collection<ScalarParameterDefn> parameterDefinitionCollection = parameterDefinitionTask.getParameterDefns(true);
Iterator<ScalarParameterDefn> parameterDefinitionIterator = parameterDefinitionCollection.iterator();
while (parameterDefinitionIterator.hasNext())
{
ScalarParameterDefn parameterDefiniton = parameterDefinitionIterator.next();
String dataType = BIRTDataType.getBIRTDataType(parameterDefiniton.getDataType());
Object value = parameterDefiniton.getDefaultValue();
String name = parameterDefiniton.getName();
//Further handeling of these values snipped.
}
My problem is the following. The Datatype is returned as a int, and since I had no luck to locate any documentation, finding out which number stood for which datatype was trail and error based. Sadly, today with a new report, I found out that the function getDataType() returned a different number for a Date parameter then previous.
Is there any documentation available where I can read up on how to understand how the datatype of the parameter translates to which int result, or, is there a much better way at getting the Datatypes of the parameters out of a report definition?
Thank you in advance.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03559 seconds