[Kexi-devel] Report Static Values

Jaroslaw Staniek staniek at kde.org
Sun Oct 12 13:49:16 UTC 2014


On 12 October 2014 09:39, Adam Pigg <adam at piggz.co.uk> wrote:
> The closes I found in the open doc  spec is
> office:value
> http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1417678_253892949
>
> So, I proposed
> report:string-value for fields / text / barcodes
> report:boolean-value for check box

Thanks for this deep look Adam,
(added kexi-devel where this discussion belong :) )
I've looked closely too. The attribute belongs to given report
elements, each of them has determined type.
So I think report:value is sufficient: unbound fields / text /
barcodes carry string values.
checkbox carry the bool.

report:*-value does not provide any extra hing I think, or is there
anything I missed?


PS: Related but more like a future matter:

The elements deterministically map from string to integer/float/etc
when needed *but* the question is: based on what? Bound elements know
the type from the column definition. Unbound ones may need extra
report:value-type attribute. (like for the report:value, ignored if
element gets bound).

This one looks like very detailed addition, needed in the following use case:

I am scripting the report and defining expression in the reports'
context: c = a + b.
Where: a, b are static values carried by text elements, having
report:value == "1" and "2" respectively .

What would be the value of c?
* option1: if values in a & b are understood as strings, c == "12"
* option2: if values in a & b are understood as integers, c == 3

With availability of report:value-type attr we're able to decide if we
want option 1 or 2.

Similarly, we'd be able text element "c" with data source set as
"=a.value+b.value" expression. In this case, the same question arises,
what the "c" element would display: "12" or "3"?

Alternative approach is to require user to use javasript's parseInt()
when we want the option2 (why is it so hacky? and it requires string
as input type) or a.value.toInt (we can have it implemented in
QtScript I guess one day).

Thoughts?

-- 
regards, Jaroslaw Staniek

KDE:
: A world-wide network of software engineers, artists, writers, translators
: and facilitators committed to Free Software development - http://kde.org
Calligra Suite:
: A graphic art and office suite - http://calligra.org
Kexi:
: A visual database applications creator tool - http://calligra.org/kexi
Qt Certified Specialist:
: http://www.linkedin.com/in/jstaniek


More information about the Kexi-devel mailing list