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)
add dimension and mesures dynamically in crosstab
Birtsnew
Hi,
How can i add dimensions and mesures dynamically in crosstab?
Thanks
Sam.
Find more posts tagged with
Comments
JasonW
Take a look at these posts:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1181-dynamic-xtab-creation-using-script/
and
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1201-add-sort-to-crosstab-using-de-api-in-script/
Jason
Birtsnew
Jason,
Now i can able to add the dimension and measures dynamically, But when a select the dimension and measures in parameter,it's replacing the existing dimension and measures.if i wants to display two dimensions and two measures what needs to do? (i want the new one should not replace the existing dimensions and measures, need to append). and also i am not creaing the crosstab dynamically.
Thanks
Sam.
JasonW
Inserting should be appending. If you look at the dynamic xtab example changing the measures code to:
//Measures
measure = cubeHandle.getMeasure(params["Measure"].value);
mvh = xtabHandle.insertMeasure(measure, 0);
mvh.getCell().getContents().get(0).setProperty("style", "mydata");
mvh.addHeader( );
labelHandle = elementFactory.newLabel( null );
labelHandle.setText( measure.getName() );
mvh.getHeader( ).addContent( labelHandle );
measure2 = cubeHandle.getMeasure("PROFIT");
mvh = xtabHandle.insertMeasure(measure2, 0);
mvh.getCell().getContents().get(1).setProperty("style", "mydata");
mvh.addHeader( );
labelHandle = elementFactory.newLabel( null );
labelHandle.setText( measure.getName() );
mvh.getHeader( ).addContent( labelHandle );
It will insert both measures.
Jason
Birtsnew
Thanks Jason.
I will try this.
-Sam.