birt icon indicating copy to clipboard operation
birt copied to clipboard

Improving support for displaying data from XML subtrees

Open Markus-Elfring opened this issue 3 years ago • 6 comments

I am trying the software “birt-report-designer-all-in-one-4.9.0-20220315-linux.gtk.x86_64.zip” out also together with the following files.

Data source:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<test_data> 
<product>
<id>123</id>
<contributor>
<key>Test-Person1</key>
<name>Demo Check</name>
</contributor>
</product>
</test_data>

Query result preview: preview-example-20220329

Test result: The data from the XML area “contributor” are not shown (according to the XPath “/contributor” in relationship to the row mapping “/test_data/product”) so far.

:crystal_ball: Would it become possible to display the data of an XML subtree within a report list (without specifying corresponding elements explicitly)?

Markus-Elfring avatar Mar 29 '22 08:03 Markus-Elfring

For complex objects (I mean: not scalar) it should possible to create a patch that displays the class of the object and (if it's a Java object) its toString() value. But I don't think that's a good idea, because if the XML is bigger than your tiny example (eg 20MB size) that output is unusable anyway - and it could result in OOM exceptions.

hvbtup avatar Mar 29 '22 09:03 hvbtup

For complex objects (I mean: not scalar) it should possible to create a patch that displays the class of the object and (if it's a Java object) its toString() value.

Further software evolution would be nice in such a direction.

But I don't think that's a good idea, because if the XML is bigger than your tiny example

Data sizes will vary as usual.

that output is unusable anyway …

How do you think about to take any data size restrictions better into account?

Markus-Elfring avatar Mar 29 '22 10:03 Markus-Elfring

Personally, I never use the "preview results", because it doesn't work anyway for the reports I develop. But I don't miss it. I am using BIRT to access JDBC data sets.

I used XML input only once several years ago and I faintly remember that it was quite hard to achieve what I wanted.

For XML input, I think it is much harder to restrict input size (compared with SQL).

hvbtup avatar Mar 29 '22 10:03 hvbtup

I am referring to query result previews for such questionable software behaviour so that other open issues with report layout settings do not distract from more desirable solution ideas.

Markus-Elfring avatar Mar 29 '22 10:03 Markus-Elfring

Note: "questionable" means "fragwürdig" in German - it has a negative connotation. Back to the initial question: What exactly would you expect to display for "contributor" - the whole XML subtree? Pretty-printed?

Can you provide a PR?

hvbtup avatar Mar 29 '22 12:03 hvbtup

What exactly would you expect to display for "contributor" -

Further helpful information.

the whole XML subtree?

Yes. (For the data with which I am fiddling at the moment.)

Pretty-printed?

Dedicated data formatting would occasionally be nice.

Can you provide a PR?

Not directly.

I am unsure if circumstances will evolve in ways which will make contributions as pull/merge requests (from me) more likely.

Markus-Elfring avatar Mar 29 '22 12:03 Markus-Elfring