Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » user properties quick question
user properties quick question [message #468250] Tue, 04 August 2009 17:28 Go to next message
Dean Hiller is currently offline Dean HillerFriend
Messages: 46
Registered: July 2009
Member
We have designed our web GUI to ask the engine what the parameters are for
the report and then display those parameters to the user. In one case, I
want the report writer to be able to add a property to the toDate report
parameter of maxRange so that the report write can define the max amount
between fromDate and toDate...some of our reports can only be run for a 24
hour period and some have a maximum of one month.

I click toDate report param and go to User Properties tab and click add
and it only asks me for the name and type of the property but I want to
enter a value as well like 1 day or 31 days, etc. How do I do this? Is
this even possible?

I have been thinking of overriding Help Text to do this, but obviously I
would rather have our engine suck Help Text into the help of each field.

thanks,
Dean
more info... [message #468257 is a reply to message #468250] Tue, 04 August 2009 17:55 Go to previous messageGo to next message
Dean Hiller is currently offline Dean HillerFriend
Messages: 46
Registered: July 2009
Member
Well, I added a NamedExpression which seems to show up in the properties.
Here is the weird part though. In debug mode, inside
IScalarParameterDefn, I see a customProperties Map which contains my
NamedExpression of value '1'. I then call getUserPropertyValues() and it
returns a null Map. I call getUserPropertyValue('maxRange') and it
returns null....it is like I have no access to this customProperties
map????? Not sure what getUserPropertyValues is for now.....quite
weird....anyone have any ideas?
thanks,
Dean
work around for other people [message #468275 is a reply to message #468257] Tue, 04 August 2009 19:41 Go to previous message
Dean Hiller is currently offline Dean HillerFriend
Messages: 46
Registered: July 2009
Member
well, here is a hack workaround(BIRT 2.3.2) for people to access
NamedExpression(just use these as the properties since you can set values
on them)....then add this method to access the properties Map so you can
get your properties in your web application from the report parameters....

//contains all the metadata to render report correctly...
//This is the report parameter retrieved from the report.
private ScalarParameterDefn metaData;

and the code to access the customProperties out of that variable
is(basically how you access a private field in java)......

public Map getUserProperties() {
Class<ParameterDefnBase> c = ParameterDefnBase.class;
Field field;
try {
Field[] declaredFields = c.getDeclaredFields();
field = c.getDeclaredField("customProperties");
field.setAccessible(true);
Map map = (Map)field.get(metaData);
return map;
} catch (Exception e) {
throw new RuntimeException("exception", e);
}
}

I hope this helps someone.
later,
Dean
Previous Topic:Difficulty with BIRT Tutorial
Next Topic:90% sure this is BIRT bug...
Goto Forum:
  


Current Time: Thu Mar 28 15:57:15 GMT 2024

Powered by FUDForum. Page generated in 0.03818 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top