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)
How to add attributes to Label elements
sharma1983
<p>Hi All ,</p><p> </p><p>i'm trying to set hyperlink on dynamically created level for sorting i'm using following script in beforeFactory</p><p> </p><p>importPackage(Packages.org.eclipse.birt.report.model.api.elements);
dataHandle = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement(mylabel);
ac = StructureFactory.createAction();
ah = dataHandle.setAction( ac );
ah.setLinkType("drill-through");
ah.setReportName("SummaryReport.rptdesign");
ah.setTargetFileType("report-design");
ah.setTargetWindow("_self");
pb = StructureFactory.createParamBinding();
pb.setParamName("STATION");
pb.setExpression("dataSetRow["STATION"]");
ah.addParamBinding(pb);</p><p> </p><p>i need your help for this its give this error : TypeError: Cannot call method "setAction" of null</p><p> </p><p>Thanks in advance</p><p>mukesh</p>
Find more posts tagged with
Comments
pricher
<p>Hi Mukesh,</p><p> </p><p>The variable dataHandle is not instantiated correctly. if mylabel is a variable pointing to your label, verify that its value is correct. If not, use the name of your label in double quotes, i.e.:</p><p> </p><p>dataHandle = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("mylabel");</p><p> </p><p>Hope this helps,</p><p> </p><p>P.</p>
sharma1983
<p>Now this is is resolved</p><p> </p><p>thanks</p>
sharma1983
<p>Hi i need to add sort condition by using script in birt on before factory</p><p> </p><p>my code is : var reportRunnable = reportContext.getReportRunnable();
var reportDesign = reportRunnable.getDesignInstance();
var table = reportDesign.getTable("SummaryReport");
var sortCondition = org.eclipse.birt.report.engine.api.script.element.StructureScriptAPIFactory.createSortCondition();
sortCondition.setKey("dataSetRow["STATION"]");
if (params["SortDir"].value == "Desc"){
sortCondition.setDirection("desc");
}
else
{
sortCondition.setDirection("asc");
}
table.addSortCondition(sortCondition);</p><p> </p><p> </p><p>this is working file in my local birt version but when i upload it os server then gives an error in </p><p> </p><p>org.eclipse.birt.report.engine.api.script.element.StructureScriptAPIFactory.createSortCondition();</p><p> </p><p> createSortCondition is deprecated</p><p> </p><p>Thanks</p><p>Mukesh</p>