Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:34 Go to next message
Gibran Shah is currently offline Gibran ShahFriend
Messages: 33
Registered: September 2013

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:

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 15:37]

Report message to a moderator

Re: dynamically adding new columns to scripted grid from elementFactory [message #1197167 is a reply to message #1165842] Tue, 19 November 2013 19:49 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

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.


Developer Evangelist, Silanis
Previous Topic:setting grid position in script
Next Topic:Invoke Client Side Java Script from a Table Cell
Goto Forum:

Current Time: Thu Jun 01 22:56:30 GMT 2023

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

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

Back to the top