Displaying html tags produced by iDempiere (ckeditor) in jasper

1,608 views
Skip to first unread message

Anozi Mada

unread,
Mar 17, 2015, 4:04:39 AM3/17/15
to idem...@googlegroups.com
Hi community,

Today I tested some simple html tags produced by ckeditor and trying to display it in jasper report.
The following is working:
  • underline
  • subscript
  • superscript
  • color
  • background color

and the following is not working

  • bold
  • italic
  • strikethrough

Then I play a bit with ckeditor configuration but it only solve bold and italic (patch attached). Also I never use *piere standard form so I don't really know if this patch will break it or not. So I don't create the jira ticket yet and just leave it here in case someone need it.


Regards,

Anozi Mada

JasperFriendlyHTMLMarkup.patch

Anozi Mada

unread,
Mar 17, 2015, 4:17:09 AM3/17/15
to idem...@googlegroups.com
oh I forgot to mention that ordered list and unordered list are working too :)

Hiep Lq

unread,
Mar 17, 2015, 3:21:49 PM3/17/15
to idem...@googlegroups.com
Hi Anozi.
just play with jasper report.
test content: "<p style='background-color:yellow;text-decoration: line-through;'>HTML paragraph</p>"

1. use html component, it's display correct
2. use text field component with markup is html, has not strikethrough as you mean.

in case you use html component, what's content generate by ckeditor?

Anozi Mada

unread,
Mar 18, 2015, 12:03:57 AM3/18/15
to idem...@googlegroups.com
Thanks for the response Hiep

iDempiere ZK is using ckeditor as its html editor. You can access it by right clicking any string field in iDempiere ZK, choose editor and switch to tab html.
The idea is user fill the field using html editor and want it to render properly in jasper report, at least for simple markup like bold.
I have configured simple jasper report in demo.idempiere.com, you can try it by print preview Requisition 900000 as seen in the attachment. I also deploy it as jrxml attachment so you can download it if you want to test it locally.
RequisitionJasper.png

Carlos Antonio Ruiz Gomez

unread,
Mar 18, 2015, 10:27:23 AM3/18/15
to idem...@googlegroups.com
Anozi, I changed on req900000 some tags manually and jasper shows them correctly.

<b> instead of <strong>
<strike> instead of <s>
<i> instead of <em>

Check
http://stackoverflow.com/questions/19226388/ckeditor-use-b-tags-instead-strong
http://ckeditor.com/forums/Support/CKEditor-bold-b-not-strong-italic-i-not-em

Regards,

Carlos Ruiz
--

Carlos Antonio Ruiz Gómez

unread,
Mar 18, 2015, 11:07:35 AM3/18/15
to idem...@googlegroups.com
:)  Just noticed your patch on the first post is precisely implementing that   :)   Thanks for contributing.

Anozi Mada

unread,
Mar 19, 2015, 4:57:21 AM3/19/15
to idem...@googlegroups.com
That's it! Thanks Carlos, I didn't know about strike yet before.
I've created the jira ticket https://idempiere.atlassian.net/browse/IDEMPIERE-2527

Henrique Canto

unread,
Apr 9, 2015, 10:00:15 AM4/9/15
to idem...@googlegroups.com
Hi Anozi!

Im using ckeditor with IReport and Im same problem.

Where I  should use this pacth?

Thx

Anozi Mada

unread,
Apr 9, 2015, 10:32:46 AM4/9/15
to idem...@googlegroups.com
The information is already in the patch that I attached to https://idempiere.atlassian.net/browse/IDEMPIERE-2527
The file is /org.adempiere.ui.zk/js/ckeditor/config.js
Hope it will helps

Henrique Canto

unread,
Apr 14, 2015, 9:54:25 AM4/14/15
to idem...@googlegroups.com
Thx a lot!

It worked the change of tag! But, the jasper still not display HTML correctly...

I just picked up the string in the request and sent to Jasper.

I do not know if it's the right way:

String content = request.getParameter("editor1");

...

map.put("content", content);


jasper.setMap(map);



Any idea?

Thx


Anozi Mada

unread,
Apr 14, 2015, 9:49:01 PM4/14/15
to idem...@googlegroups.com
Can you give me the example of your html string?
I don't quite understand why you do it but do you use the html string as parameter?

Nicolas Micoud

unread,
May 7, 2018, 10:46:05 AM5/7/18
to iDempiere
Hello,

Facing same issue in v5.1
I integrated the patch that worked well in 2.1 (seems it never made his way in trunk).
Trying now to integrate it in current 5.1 version, but it has no effect.

Anybody can confirm please ?

Thanks,

Nicolas
Reply all
Reply to author
Forward
0 new messages