Print equivalent of Element Specification

Uploaded report templates and discussions about reports.

Moderators: sarawut_w, Moderators

Re: Print equivalent of Element Specification

Postby SteveS » Thu Jan 10, 2019 1:15 pm

Hello Sarawut,

Thank you for that elementtool.jar extension. It did return the complete list of properties/attributes for the element, so that's good.

However, it returns what looks like a "humanName" form of the property name. I also need to retrieve the property value from the specification, and the returned property name in its current form doesn't seem to allow me to do that.

Would it be possible for you to revise the elementtool.jar to return a form of the property name that can be used with the helper module function $profiling.getElementProperty(element, propertyName)?

As a reminder, my goal is to basically create a report that mimics the element specification dialog. So my final formatted report will include a two column table that shows the element property name and the element property value. Ideally, both of those columns will be "human-friendly" forms.

I'm hoping to get to template code that looks something like the following (extending your sample code):
Code: Select all
#import("eTool","com.nomagic.reportwizard.tools.ElementTool")
#foreach($b in $Block)
#foreach($prop in $eTool.getPropertiesName($b))
$prop --> $profiling.getElementProperty($b, $prop)
#end
#end

or perhaps:
Code: Select all
#import("eTool","com.nomagic.reportwizard.tools.ElementTool")
#foreach($b in $Block)
#foreach($prop in $eTool.getPropertiesName($b))
$profiling.getHumanPropertyName($b, $prop) --> $profiling.getElementProperty($b, $prop)
#end
#end

Some kind of modification to elementtool.jar that returns the names and values I'm looking for would also be perfectly acceptable ;) .
Thank you for your help on this!
Steve S.
SteveS
Forum Newbie
Forum Newbie
 
Posts: 11
Posts Rating:0
Joined: Mon Sep 10, 2018 4:08 pm
Full name: SteveS

Re: Print equivalent of Element Specification

Postby sarawut_w » Thu Jan 10, 2019 9:10 pm

Hello Steve,

You may try this code:
Code: Select all
#import("eTool","com.nomagic.reportwizard.tools.ElementTool")
#foreach($b in $Block)
#foreach($prop in $eTool.getQProperties($b))
$prop.getName() : $prop.getValueStringRepresentation()
#end
#end


Best regards,
Sarawut
sarawut_w
No Magic
No Magic
 
Posts: 328
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Re: Print equivalent of Element Specification

Postby SteveS » Fri Jan 11, 2019 5:33 pm

Sarawut,

Yes! That pretty much provides what I was looking for. I sort by name to get the same order as in the specification dialog box.
:D :D :D
I do notice that some of the property values are not exactly the same as what's shown specification. Most of the differences are in the customization elements, but I've noticed a few in other element types also. I don't know yet if it's a problem for what I'm doing, but will get back on this thread if it is.

There's one other thing I've seen that looks like a bug, but I'm wondering if it is a known problem...
I'm using MS Word .docx for my document template. The problem is that the VTL #set directive is inserting a "hard return" character (i.e. an end-of-paragraph marker), even though that character is not in template file. So I'm getting line breaks where I don't want them, and there's no way to remove them from the template file. They just show up in the output file wherever the #set directive is located.
Do you know if this is a known problem, or if there is a workaround, or is a bug report required?

Thanks again for your help on this!
Steve S.
SteveS
Forum Newbie
Forum Newbie
 
Posts: 11
Posts Rating:0
Joined: Mon Sep 10, 2018 4:08 pm
Full name: SteveS

Re: Print equivalent of Element Specification

Postby sarawut_w » Sun Jan 13, 2019 9:11 pm

Hello Steve,

Thanks again for your help on this!

You are welcome!
We help you with our pleasure.

Do you know if this is a known problem, or if there is a workaround, or is a bug report required?

Could you please provide us the sample template, project as well as expected report?

Best regards,
Sarawut
sarawut_w
No Magic
No Magic
 
Posts: 328
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Re: Print equivalent of Element Specification

Postby SteveS » Mon Jan 14, 2019 10:31 am

Sarawut,
I've attached a template that shows the issue. It can be run from any project. I've also attached a file that shows what I would expect the output to look like if the issue did not exist.

If you look at the template and the output files in MSWord with showing of hidden characters turned on, you'll see that there is only one "hard-return" (i.e. paragraph break) at the end of the file. At the end of the other lines is a simple line break (created with SHIFT-ENTER).

In the generated output, there are two additional "hard-return" paragraph break characters inserted at the location of the #set directives in the template. These additional characters create extra blank lines (line spaces) where they are not wanted.

Please let me know if there is a workaround for this issue, or if you are not seeing the issue.

Steve S.
You do not have the required permissions to view the files attached to this post.
SteveS
Forum Newbie
Forum Newbie
 
Posts: 11
Posts Rating:0
Joined: Mon Sep 10, 2018 4:08 pm
Full name: SteveS

Re: Print equivalent of Element Specification

Postby sarawut_w » Mon Jan 14, 2019 9:25 pm

Hello Steve,

Thank you for your sample project and expected output.
This is a bug, we have already registered it to our internal bug tracking system.
It is going to be fixed in later version.

For your workaround, if you do not concern about type of line break, you may use paragraph line break instead of simple line break.
sample.png


Best regards,
Sarawut
You do not have the required permissions to view the files attached to this post.
sarawut_w
No Magic
No Magic
 
Posts: 328
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Previous

Return to Report Engine

Who is online

Users browsing this forum: No registered users and 1 guest