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)
Creating rows dynamically from dataset script
rojanu
<p>I am trying to create rows dynamically according to items in a HashMap but failing miserably so far.</p><p>in dataset fetch method I have, which works when I have the rows fixed</p><pre class="_prettyXprint">var msgMap = new Packages.com.cs.parser.MessageParser.parse(myJSONObject[aKeys[count]].C_MSG_CONTENT.replace(/^/g,"n"));row["ID"] = aKeys[count]; row["MSG_TYPE"] = msg_type; row["SEND_BIC"] = send_bic; row["PROC_TIME"] = proc_time; //row["TAG_27"] = msgMap.getTag("27"); iter1 = msgMap.keySet().iterator(); while(iter1.hasNext()){ key = iter1.next(); row["TAG_"+ key] = msgMap.getTag(key); }</pre><p>But the problem is that the size of the HashMap is not fixed and can go into hundreds and I don't want to manually create a row for each possible entry. I tried to do</p><pre class="_prettyXprint _lang-js">configTable = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("configTable");elementFactory = reportContext.getReportRunnable().designHandle.getElementFactory();row = this.getRowData();rowNo=3;iter1 = swiftMessage.keySet().iterator();while(iter1.hasNext()){ key = iter1.next(); value = msgMap.getTag(key); rowParm = new RowOperationParameters(2, -1, rowNo); configTable.insertRow(rowParm); myNewRow = configTable.getDetail().get(rowNo); tblCell = myNewRow.getCells().get(0); label = elementFactory.newLabel("tblCell"); label.setText(key); tblCell.getContent().add(label); myNewRow = configTable.getDetail().get(rowNo); tblCell = myNewRow.getCells().get(0); label = elementFactory.newLabel("tblCell"); label.setText(value); tblCell.getContent().add(label); rowNo++;}</pre><p>but nothing shows on the report.</p><p> </p><p>Any ideas?</p>
Find more posts tagged with
Comments
There are no comments yet