comments in jrxml are erased by iReport

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.

 

alexeysem's picture
204
Joined: Mar 29 2010 - 6:17am
Last seen: 13 years 6 months ago

15 Answers:

 hi my friend.

 

I have this same problem than you.

 

you found solution ?

Please, if you found this, you can help me ?

Thanks.

 

 

marciotw's picture
229
Joined: Apr 22 2010 - 11:58am
Last seen: 3 weeks 2 days ago

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. 

alexeysem's picture
204
Joined: Mar 29 2010 - 6:17am
Last seen: 13 years 6 months ago
I go continue with this problem..
Thanks my friend.
marciotw's picture
229
Joined: Apr 22 2010 - 11:58am
Last seen: 3 weeks 2 days ago

you not found neither artifice for insert comments in files of jasperreports, for identify who make file or changes ?
Because i need insert information about developer and what for serving this codes.
Thanks more a time.

marciotw's picture
229
Joined: Apr 22 2010 - 11:58am
Last seen: 3 weeks 2 days ago
Has anyone come up with any creative ideas to have xml comments stay intact?
slinkeey's picture
201
Joined: Feb 20 2009 - 2:09pm
Last seen: 14 years 7 months ago

I just tyhought of it I think..

Add the comments like Author and revision information to the SQL Statement..

slinkeey's picture
201
Joined: Feb 20 2009 - 2:09pm
Last seen: 14 years 7 months ago

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

alexeysem's picture
204
Joined: Mar 29 2010 - 6:17am
Last seen: 13 years 6 months ago

Thanks for the Advice.  This is a nice idea..

I decided to just put them before the SQL statement so that it shows in the SQL window at the top..  It works out just fine for now..

Thanks!!

slinkeey's picture
201
Joined: Feb 20 2009 - 2:09pm
Last seen: 14 years 7 months ago

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.

pablodc's picture
823
Joined: Jul 4 2007 - 4:59am
Last seen: 16 years 2 months ago

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.

 

radhikasharda's picture
Joined: Mar 29 2011 - 4:32am
Last seen: 12 years 6 months ago

Is there a filed issue at the issue tracker for this?

hablutzel1_1's picture
Joined: Mar 12 2013 - 11:11am
Last seen: 4 years 10 months ago

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)

hablutzel1_1's picture
Joined: Mar 12 2013 - 11:11am
Last seen: 4 years 10 months ago

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.

majerus.eric's picture
Joined: Aug 27 2013 - 7:49am
Last seen: 9 years 11 months ago

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.

kbailey - 9 years 9 months ago

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

showboxapk1 - 7 years 6 months ago

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.

fireslinger - 5 years 1 week ago

This is a very old thread but for those still searching for a solution, the best I can think up of is to put them in properties.

hozawa's picture
190617
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 years 3 months ago

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

williamsdanielusa's picture
Joined: Sep 15 2022 - 7:36pm
Last seen: 1 year 1 week ago
Feedback