2 questions:
1. I was wondering whether it was possible to nest a print-table tag in a foreach loop. Each time I try I get a NullPointerException, upon debugging it seems like the print-table has a problem getting its sequence holder. Any ideas?
2. is there any way to dynamically specify which sequence a foreach should use?
What I'm trying to do is create a document with customer 'sections' containing tables with data for the customer, that would look something like this:
where table[s] corresponds to a ReportTable containing the data for section s. So far I haven't been able to get the tables to figure out which sections they belong too (because I can't dynamically specify the sequences)....
Thanks in advance,
Cae
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just added the loop-variable attribute, but I think you've only forgotten that in your xml snippit. I changed the expression at the sequence attribute of the print-table tag into '${table[${s}]}'. Your form '${table[s]}' is not supported in the current version. I will change that for 0.9.7 (in fact the fix is already in CVS).
Best regards,
Christian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thank you for providing me with informations about weaknesses and bugs in UJAC. People like you help a lot to improve open source software. As a little thank you from me, here's the solution for your request:
I've added the support for sections. There are two tags now: chapter and section. It's all in CVS including a test template (section-test.xml). Additionally I've added the also missing possibility to define a horizontal alignment at the paragraph tag.
Best regards,
Christian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks once again for the quick response and the addition of sections. I was playing around with them today and realized that they have one bad side effect - that they always have to include paragraphs (I remember having to work around that in iText). I could use the outline tag, but then I wouldn't be able to nest my bookmarks like I could with sections.
I played around in the source code some and got the outline tag to support a 'parent' attribute. Using the titles of the outlines as keys I was then able to nest bookmarks with the outline tag as well. It's a little dirty, but it works.
I was wondering if you could include something like a 'parent' attribute for the outline tag in ujac. I can send the code for how I did it (it isn't much) if you would like, but since it is a relatively simple addition that I made you probably wouldn't need it.
Anyway, thanks again for the fixes.
Cae
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've added the parent attribute to the outline tag as well as a name attribute that defines the name of the outline, which can be referenced through the parent attribute of another tag.
Additionally, I've added support for the attributes 'x' and 'y' to define the position for an outline absolutely.
I've extended the test template 'anchor-test.xml' to demonstrate the new feature.
Best regards,
Christian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
2 questions:
1. I was wondering whether it was possible to nest a print-table tag in a foreach loop. Each time I try I get a NullPointerException, upon debugging it seems like the print-table has a problem getting its sequence holder. Any ideas?
2. is there any way to dynamically specify which sequence a foreach should use?
What I'm trying to do is create a document with customer 'sections' containing tables with data for the customer, that would look something like this:
<foreach sequence="${sections}" loop-variable="s">
<paragraph>${s}</paragraph>
<print-table sequence="${table[s]}">
</print-table>
</foreach>
where table[s] corresponds to a ReportTable containing the data for section s. So far I haven't been able to get the tables to figure out which sections they belong too (because I can't dynamically specify the sequences)....
Thanks in advance,
Cae
Hi Brandao,
just to get you right: sections holds a list with Strings, and table holds a map with String keys and ReportTable instances as values?
In this case your very near to the solution, this variation should work:
<foreach sequence="${sections}" loop-variable="s">
<paragraph>${s}</paragraph>
<print-table sequence="${table[${s}]}" loop-variable="row">
</print-table>
</foreach>
I've just added the loop-variable attribute, but I think you've only forgotten that in your xml snippit. I changed the expression at the sequence attribute of the print-table tag into '${table[${s}]}'. Your form '${table[s]}' is not supported in the current version. I will change that for 0.9.7 (in fact the fix is already in CVS).
Best regards,
Christian
Christian,
Thanks for the quick reaction to my question and for writing such a cool library. I updated my ujac version, changed the script and it works now.
I was wondering whether you were planning on supporting anything similar to iText sections in a future version of ujac?
Thanks again,
Cae
Hi Brandao,
thank you for providing me with informations about weaknesses and bugs in UJAC. People like you help a lot to improve open source software. As a little thank you from me, here's the solution for your request:
I've added the support for sections. There are two tags now: chapter and section. It's all in CVS including a test template (section-test.xml). Additionally I've added the also missing possibility to define a horizontal alignment at the paragraph tag.
Best regards,
Christian
Christian,
Thanks once again for the quick response and the addition of sections. I was playing around with them today and realized that they have one bad side effect - that they always have to include paragraphs (I remember having to work around that in iText). I could use the outline tag, but then I wouldn't be able to nest my bookmarks like I could with sections.
I played around in the source code some and got the outline tag to support a 'parent' attribute. Using the titles of the outlines as keys I was then able to nest bookmarks with the outline tag as well. It's a little dirty, but it works.
I was wondering if you could include something like a 'parent' attribute for the outline tag in ujac. I can send the code for how I did it (it isn't much) if you would like, but since it is a relatively simple addition that I made you probably wouldn't need it.
Anyway, thanks again for the fixes.
Cae
Brandao, Hi again!
I've added the parent attribute to the outline tag as well as a name attribute that defines the name of the outline, which can be referenced through the parent attribute of another tag.
Additionally, I've added support for the attributes 'x' and 'y' to define the position for an outline absolutely.
I've extended the test template 'anchor-test.xml' to demonstrate the new feature.
Best regards,
Christian