Skip to main content



      Home
Home » Archived » BIRT » dynamically adding new columns to scripted grid from elementFactory
dynamically adding new columns to scripted grid from elementFactory [message #1165842] Fri, 01 November 2013 11:34 Go to next message
Eclipse UserFriend
Hello,

I'm experimenting with creating grids and tables in script using the elementFactory object. I've created a 1x1 grid like this:

var elementFactory = reportContext.getDesignHandle().getElementFactory();
var newGrid = elementFactory.newGridItem("NewGrid", 1, 1);

Now I'm wondering if there's a way to add additional columns dynamically. For example, at some point (when I get the results of my dataset) I'm going to want to add n amount of items to my grid (because the dataset will have n rows). So I'll need to add n-1 additional columns to the grid.

I've had a look at this website but I don't see any function for doing this:

http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.birt.doc.isv%2Fmodel%2Fapi%2Forg%2Feclipse%2Fbirt%2Freport%2Fmodel%2Fapi%2FGridHandle.html

I see functions like pasteColum(...) and insertAndPasteColumn(...) but these seem to take a columnNumber, and since I want a new column, the columnNumber would be something out of bounds (the description of columnNumber says "columnNumber - the column index from 0 to the number of columns in the grid").

Is there a way to accomplish what I want?

[Updated on: Fri, 01 November 2013 11:37] by Moderator

Re: dynamically adding new columns to scripted grid from elementFactory [message #1197167 is a reply to message #1165842] Tue, 19 November 2013 14:49 Go to previous message
Eclipse UserFriend
Once you have access to your data, you won't be able to add columns to the grid. You could access your data in script using the data engine API so that you know early enough to modify your grid.

BIRT Developer Center Community DevShare - Data Engine API

If that doesn't work for you, can you explain more about what you're trying to do? Maybe I can suggest another way.
Previous Topic:setting grid position in script
Next Topic:Invoke Client Side Java Script from a Table Cell
Goto Forum:
  


Current Time: Sat May 10 10:39:27 EDT 2025

Powered by FUDForum. Page generated in 0.05466 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top