Doubt Add Single Attribute in templates/report/route.xlsx

Nikolay 2 years ago

Hello everyone,

I'm trying to make a small modification to templates/report/route.xlsx

I have created a computed attribute

Device Temperature
io11 ? io11 : null
Number

In the Attributes column I see it as deviceTemp

I've extended the area with a few columns H9 -> M9

I have named the column I8 -> DeviceTemp

In column I9 -> ${position.attributes.deviceTemp}

Naturally if I ask, then something is wrong. ;)

Either I'm generically wrong or there's a problem with the data type (-111.22) or there's a possibility of null in the computed attribute Device Temperature .

Any guesses?

P.S. I'm using Libre office calc for editing

Greetings!

Anton Tananaev2 years ago

So, what is the problem exactly?

Nikolay 2 years ago

The problem is that I see in the column Attributes (H9) ...,deviceTemp=-111.22, but in the column deviceTemp (I9) there is no value for ${position.attributes.deviceTemp}.

;)

Anton Tananaev2 years ago

Did you extend the area correctly? There are several places where you need to do it.

Nikolay 2 years ago

Hi Anton,

The places I have corrected are:

jx:area(lastCell="M9")
jx:each(items="devices", var="device", lastCell="M9" multisheet="sheetNames")
jx:each(items="device.objects", var="position", lastCell="M9")

After confirming that things should be OK, I looked for the problem in Libre Office.

I can confirm that the above configuration works as expected if made under MS Office 365.

I can also say that the above configuration does not work under LibreOffice Calc ->

Version: 6.0.7.3
Build ID: 1:6.0.7-0ubuntu0.18.04.12
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group
Anton Tananaev2 years ago

I'm actually using LibreOffice myself and never had such problems. Not sure about the version though.

Nikolay 2 years ago

I'm not sure yet why this happens, but what I saw is that the cell formatting in LibreOffice stays as undefined, which is very strange and the first time I've seen it.
I'll try to get the Number formatting right in the template a bit later and write if that's the problem.

Cheers ;)

Nikolay 2 years ago

Yep, if I mark the whole I9 column in the template and format it as Number. Things work under LibreOffice.