Hi,
I have a very short question. On saving a jrxml document in iReport it does reformats the xml source code. That would be okay if it didn't also remove all comments. This is rather annoying as I 1. cannot leave any comments for the further supporters of the very non-trivial report I'm developing 2. cannot comment elements I don't need while debugging.
So, is it possible to disable source reformatting in iReport, or fine-tune it to keep the comments? I hope it is...
Thanks in advance.
15 Answers:
Hi,
As you might have noticed, every time you do something in iReport's visual editor and then switch to the jrxml source, it looks like it fully reformats the code.
Actually, as they say, it doesn't simply reformat, it simply exports the internal representation of the report.
So, what iReport works with is only that internal representation, and surprisingly there's no place in it for preserving the original formatting or at least the comments.
To sum it up: currently there's no way to keep the comments.
I personally treat this as a miserable failure, as the whole JRXML language seems to be very well focused on being readable and understandable, especially compared to e.g. BIRT reports, which quickly become huge and monstrous. I guess they just didn't have time or spare hands to implement this feature.
Hope this helps,
A.
See my answer few comments above:
"To sum it up: currently there's no way to keep the comments."
And just don't waste your time on this issue...
If you need comments in the beginning of the end of the file, you could just keep them in a separate file (e.g. "file.jrxml.comm") and expand your building tool to merge them before a check-in.
Note that you'll go straight to the hell after your death if you follow this advice :)
Hi,
In JR 3.7.x there are a element called "callouts". You can reach these in IR under the Pallet Window. These "callouts" works like sticky notes in the IR interface and in the generate XML it can be readed like this:
<property name="ireport.callouts" value="##Fri Nov 12 23:12:35 GMT-03:00 2010\\ncallouts.1.text=Hello World!, I'm a callout...\\ncallouts.1.bounds=294,80,181,73"/>
Grettings from Argentina!
PS: I have attached a screenshot.
hi!
When are we going to have a comment facility in Jasper reports? Its really bothering issue comments get deleted. I am new to iReport and when I made something as a comment , to my surprise it got lost. I thought as if I hade done something wrong. But when I searched in then came to know about comments being not supported in ireports. I hope we will get this requirement fixed very soon.
Found the filled issue: http://community.jaspersoft.com/ireport-designer/issues/822
Please upvote it to get it implemented soon (you'll need to register)
Considering the issue tracker ticket was created 8 years ago, I'm assuming this will never be fixed. So, a recap of ideas/hacks here and then a couple more I've tested:
- Comment the SQL query
- Add a callout element from the Palette in the Tools category. As stated above, these are sticky notes and do not show up in the report
- Add a separate file for comments and then use a build tool to merge them (then go to hell after death)
- For parameters and fields, there is a "Description" property you could use to comment
- For variables, if you use an expression, you can include Java comments (//) in the expression but they must be on a different line than the expression being semicolons are illegal. It appears iReport uses the newline character to separate comment from expression code.
- For other elements, you can experiment with "Print When Expression" to sneak comments in. Again, they must be on their own line. If the element is always visible, then you can write your comment and then simply type "true" on the next line.
Unfortunately none of these methods let you debug by commenting out elements in the XML directly, but it's something anyway.
I also get deleted comments from time to time, getting over it maybe because my answer is off-topic so it's erased by iReport. wordle
I haven't seen this suggestion, but it's one I use from time to time. If you really must keep comments in the file, create a static text field and enter your comments there. Then set the dimensions of this field to 0,0,0,0 so that it doesn't display.
I really think this can be resolved if you keep them in properties. I was having issues like this but later I got experience in this topic. I tried to put them before the SQL statement and got wrong with it.
Thanks,
Mike
How will people notice a field with 0 dimensions? If I have room, I put the comment in a static text field with green text saying // COMMENT: and a Print When Expression Boolean.FALSE.