Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Copy Grid With Dynamic Script
Migrateduser
<p>Hy boys,</p>
<p> </p>
<div>I have a report parameter that receives the amount of labels that you want to print, I decided to copy the contents of a grid within the table dynamically according to this parameter informed. </div>
<div> </div>
<div>But I get null pointer exception could you help me? </div>
<div> </div>
<div>
<pre class="_prettyXprint _lang-js _linenums:0">
importPackage(Packages.com.ibm.tivoli.maximo.report.script)
var mxReportScriptContext = MXReportScriptContext.initialize(reportContext);
mxReportScriptContext.setDefaultLogLevel("DEBUG");
mxReportScriptContext.setDefaultLogFile("c:/temp/etiquetas.log");
//get a reference to the ElementFactory
var elementFactory = reportContext.designHandle.getElementFactory();
//Copy Dynamic
var scriptLogger = mxReportScriptContext.getReportScriptLogger();
//scriptLogger.debug(reportContext.getDesignHandle().getElementByID(4963));
var mytable = reportContext.getDesignHandle().getElementByID(4963);
var mydetail = mytable.getDetail( ).get(0);
var tcell = mydetail.getCells().get(0);
//grid = elementFactory.newGridItem(null, 1,1);
var grid = reportContext.getDesignHandle().getElementByID(2278);
tcell.getContent().add(grid);
</pre>
</div>
<p>View attach layout.</p>
<p> </p>
<p>Thanks.</p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
There are no comments yet