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 do I add My Custom Report Item to report programatically?
qos
Hello, <br />
<br />
I am trying to add programatically the custom report item i've developed to a design but with no success...<br />
<br />
I have placed the plugin in C:\birt-runtime-2_6_1\ReportEngine\plugins and with the following code I get a null pointer exception when using item... (in report designer it works ...) <br />
Can you give some tip about what can be happening?...<br />
<br />
DesignConfig dConfig = new DesignConfig( );<br />
<br />
dConfig.setBIRTHome("C:\\birt-runtime-2_6_1\\ReportEngine");<br />
<br />
DesignEngine dEngine = new DesignEngine( dConfig );<br />
<br />
SessionHandle sessionInstance = dEngine.newSessionHandle( null );<br />
<br />
String filename = "c:\\staticitem.rptdesign";<br />
<br />
ReportDesignHandle design = sessionInstance.createDesign(filename);<br />
<br />
ElementFactory factory = design.getElementFactory();<br />
<br />
SimpleMasterPageHandle masterpage = factory.newSimpleMasterPage( "Page Master" ); <br />
design.getMasterPages( ).add( masterpage );<br />
<br />
//StaticItem is custom item plugin extension name <br />
<strong class='bbc'>ExtendedItemHandle myItem = factory.newExtendedItem("Static Item", "StaticItem");<br />
myItem.setProperty("text", "mytext");</strong><br />
<br />
SlotHandle shmp = masterpage.getPageFooter();<br />
shmp.add(myItem);<br />
<br />
design.save();<br />
design.close( );
Find more posts tagged with
Comments
There are no comments yet