This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

Add calculated column to remote databook

General questions regarding the development with JVx.

Add calculated column to remote databook

Postby Davidge » Mon Sep 07, 2020 11:02 am

Hi,

is it possible to create a java site calculated column in a remote databook?

Thanks
Marco
Davidge
 
Posts: 8
Joined: Fri Aug 28, 2020 4:28 pm

Re: Add calculated column to remote databook

Postby Support@SIB » Mon Sep 07, 2020 12:07 pm

Yes, it's possible to add columns which are only available in-memory. It's also possible disable write-back feature for single columns..

You have different options:

Add the column to the databook, e.g.

Code: Select all
//before book.open();
book.getRowDefinition().addColumnDefinition(new ColumnDefinition("MYCOL",
                                            new ObjectDataType()));

Use the right datatype, e.g. StringDataType, BigDecimalDataType, ...

Fill the values with a custom row calculator:

Code: Select all
book.setRowCalculator(IRowCalculator)


The other option is that you define a column on server-side. The advantage is that such column will be sent automatically back to the server/storage. This doesn't mean that the column will be used for database operations.

The server-code:

Code: Select all
storage.getMetaData().addColumnMetaData(new ColumnMetaData("MYCOL",
                                        BigDecimalDataType.TYPE_IDENTIFIER));
         
storage.eventCalculateRow().addListener(...);
User avatar
Support@SIB
 
Posts: 349
Joined: Mon Sep 28, 2009 1:56 pm


Return to Development