Thursday, July 20, 2006

BIRT 2.1 New Features Webinar

We are putting together a webinar to demonstrate some of the new features in BIRT 2.1.
Joint Data Sets, Multi Data Set Cascaded parameters, New Charting features are just some of the topics that will be covered.
This webinar will be presented on Wednesday July 26, 2006. If interested
sign up and join us.

20 comments:

Scott Rosenbaum said...

Test comment email mechanism, no reply needed.

Anonymous said...

What time?

Jason Weathersby said...

9:00 AM PST.

Jason

Anonymous said...

Hello :)

Is it possible to change dynamically the css of a report ?
I wish :
- One rptDesign
- 5 CSS file (or rptlibrary)
- Change the path to the css file.

Have you a solution ?
If I use a library, the path in the rptdesign (xml) is only the library's NAME :(

Thanks

Jason Weathersby said...

CSS sheets can be imported and the values that they contain can be changed on the fly, but the actual sheet can not be changed.

Jason

Anonymous said...

hmm
With an image (logo for example), I can pass a report's parameter for the image URI.

Is it possible to do that with a rptlibrary (instead of an image) ?

I want to change the library path depending on the user who is accessing the report.

Anonymous said...

Hello :)

i use ScritedDataSet and appropriate EventHandler(not javascript regarding performance issue) to set displaying data from databse. In order to catch POJOs from EventHanlder i put it first in a Hashtable. This Hashtable is common to all programmes with it's public static methods.
It works fine until now, but what is it about Multithreading, how can i ensure that the EventHandler gets POJOs from a right Thread not another(each Thread gets different POJOs frim Database).

Jason Weathersby said...

This is going to be tough because the event handler gets instanitated new every time it is called. You may be to store a reference to it using the set and getPersistentGlobal Variable call.

Jason

Anonymous said...

thanks very much for the feedback, jason, but which class has the method to call: set-/get-PersistentGlobal ?

Jason Weathersby said...

This is done using the reportContext.
reportContext.getPersistentGlobalVariable("variablename")

Jason

Anonymous said...

thanks for your answer, jason, but where may be the right place to call reportContext.setPersistentGlobalVariable
() and how can i get a instance of reportContext ?

at moment i put the needed object in a
renderContext and set it again in a AppConext of a RenderandRunTask, in this case i can get the needed object again in the methods of DataSet Eventhandler per IReportConext param, but i am not sure whether this is a correct usage ?

Thanks

Jason Weathersby said...

The way you are doing it sounds fine. If you want to use the persistent global variable, when your event handler gets called, get the reportContext from the call and use:
reportContext.setPersistentGlobalVariable() .

I would probably do it in the beforeOpen method.

Jason

Sivan said...

Hi Jason!

Congrets for the new release, it's been long since we talked. Do you have an public email address I can write you to?

Cheers!

Sivan (former Zender)

Jason Weathersby said...

Sivan,

You can send me an email at jasonweathersby@alltel.net.

Good to hear from you.

Jason

Anonymous said...

Hello,

i have a problem with ScriptedDataSetEventHandler.
In method "describe" i define a column with type String by using "arg1.addColumn(COLUMN_AMOUNT, Float.class);" and in method fetch i set the value of the cloumn with "row.setColumnValue(COLUMN_AMOUNT, new Float(10));"

when i run the report i get ScriptException with "invalid data type", but when i change the column definition by "arg1.addColumn(COLUMN_AMOUNT, String.class);", the report run without error.

What is the reason of this problem ?

Thanks

Jason Weathersby said...

Can you send me the source for your class?

Anonymous said...

Hi Jason,

here are the source code of my class:
public class MyScriptedDataSetEH extends ScriptedDataSetEventAdapter {
private static final String COLUMN_AMOUNT = "Amount";

public boolean fetch(IDataSetInstance set, IUpdatableDataSetRow row) {
row.setColumnValue(setColumnValue(COLUMN_AMOUNT, new Float(10));
}

public void open(IDataSetInstance arg0) {
get business data;
}

public boolean describe(IDataSetInstance arg0, IScriptedDataSetMetaData arg1) {
arg1.addColumn(COLUMN_AMOUNT, String.class);
}

}

Thanks

Jason Weathersby said...

Try using a double like:


import org.eclipse.birt.report.engine.api.script.eventadapter.ScriptedDataSetEventAdapter;
import org.eclipse.birt.report.engine.api.script.instance.IDataSetInstance;
import org.eclipse.birt.report.engine.api.script.IUpdatableDataSetRow;
import org.eclipse.birt.report.engine.api.script.IScriptedDataSetMetaData;


public class DSEH extends ScriptedDataSetEventAdapter {


private static final String COLUMN_AMOUNT = "Amount";
private static int rwcnt = 0;

public boolean fetch(IDataSetInstance set, IUpdatableDataSetRow row) {
if( rwcnt > 0 ){
return false;
}
try{
row.setColumnValue(COLUMN_AMOUNT, new Double(10));
}catch (Exception e){
e.printStackTrace();
}
rwcnt += 1;
return true;
}

public void open(IDataSetInstance arg0) {

}

public boolean describe(IDataSetInstance arg0, IScriptedDataSetMetaData arg1) {
arg1.addColumn(COLUMN_AMOUNT, Double.class);
return true;
}
}

Anonymous said...

Hello Jason,

it works well with DOuble.class, thank you very much. but still don't understand why it doesn't work with Float.

Another question: is it possible to set sorting at run time per java code ? if yes, how should it looks like ?
Background: i can define the sorting per Property Editor "Sorting" for a table, but that happens at design time, it will be nice if this happens at run time per user request.

Thanks

Jason Weathersby said...

You should be able to access a report parameter, global variable, session variable or named expression within the expression builder on the sorting key to change it on a per user request.