[Kexi-devel] Report Static Values

Jaroslaw Staniek staniek at kde.org
Mon Oct 13 19:14:30 UTC 2014


Agree here, that was a What-If digression.

Suming up:
- Report XML element name: report:value regardless of report element type.
(added to https://community.kde.org/Kexi/Junior_Jobs/Small_report_improvements#The_Tasks
)
- added https://community.kde.org/Kexi/Plugins/Forms/Format_property design page

On 13 October 2014 08:19,  <piggz1 at gmail.com> wrote:
> ‎I am not sure the type would add anything in the a b c case.
>
> Knowing that the value-type for c is int doesn't really help...you really need to know the value-type of a and b. Don't you?
>
> I would prefer that the user is explicit in writing their expression and clearly state addition or concatenation, then we can't get it wrong.
>
> Btw, all of that is possible today with the scripting ability of reports. You can put all that code in the section -on render event and have the value of c calculated with whatever expression you like, or, if it's a simple expression, it van just go in the data - source.
>
> Sent from my BlackBerry 10 smartphone.
>   Original Message
> From: Jaroslaw Staniek
> Sent: Sunday, 12 October 2014 2:49 PM
> To: Adam Pigg; kexi-devel at kde.org
> Subject: Re: Report Static Values
>
> 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



-- 
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