RichTextArea in report doesn't work properly

Hi
RichTextArea edited field content doesn’t show in the report properly. The used format is DOCX and output to PDF.

> 
>     Job responsibility: <span style="white-space: pre; background-color: rgb(250, 249, 248);"><font size="4">JOB PURPOSE</font></span><div><ul><li><span style="font-size: 11.781000137329102px; white-space: pre; background-color: rgb(250, 249, 248);">d hfuidh gudfhg duffdfg</span></li><li><span style="background-color: rgb(250, 249, 248);"><span style="font- size: 11.781000137329102px; white-space: pre;">dkfj judgehfghfh</span></span></li><li><span style="background-color: rgb(250, 249, 248);"><span style="font-size: 11.781000137329102px; white-space: pre;">dfgfhgfhfgh</span></span></li><li><span style="background-color: rgb(250, 249, 248);"><span style="font-size: 11.781000137329102px; white-space: pre;"> ghjkjd fgfjdgi jdu dughduig hdhughdfug hdfugh dfuhg dfugfdg df</span></span></li><li><span style="background- color: rgb(250, 249, 248);"><span style="font-size: 11.781000137329102px; white-space: pre;">dj fjgfdj gdfg fd</span></span></li></ul><div><span style="white-space: pre;"><b><font size="4">PEOPLE MANAGEMENT</font></b></span></div></div><div><ul><li><span style="font-size: 11.781000137329102px; white-space: pre;">Dd j figdfg </span></li><li><span style="font-size: 11.781000137329102px; white-space: pre;">dfgdfg f. dkgjdgd fg fgdf gdf gfd</span></li><li><span style="font-size: 11.781000137329102px; white-space: pre;">df gdfg fgf</span></li></ul><div><span style="font-size: 11.781000137329102px; white-space: pre;"><br></span></div></div>

I see it was an old issue but wondering if this has not been fixed yet. Though I have tried using doc file but it’s also not working.

Hi.

Judging by your last question, has the issue been resolved?

Regards,
Nadezhda.

Hi @n.shatalova
Thanks for asking, not yet. Can you please have a look?

regards

I tried to reproduce your issue using pretty complicated formatted string like this:

 <b><i><font size="5">TeST NAME:</font></i></b><div><ul><li style="text-align: right;">first line</li><li style="text-align: center;"><strike>second line&nbsp;</strike></li><li><span style="background-color: blue;">jhskgjsth</span></li><li><b>sfhtsfhsfhsfj</b></li><li>sfgjsfjsfjsfg</li><li>sfgjsgjsgjs</li><li><b>sgsgsgfjsfgj</b></li><li><i>sfgjsfgjsfgj</i></li><li>sfgjsfgjsfgj</li><li><span style="background-color: green;">sfgjsfgjsfgj</span></li><li><span style="background-color: green;">sfgjsfgjs</span></li><li><span style="background-color: red;">fsgsgjss</span></li></ul></div>

But as a result i haven’t had tags in report:

Do you create correct value format using ${html} format string?

And which platform and add-on version do you use?

Hi @n.shatalova
Thanks for suggesting to use {html} format. I have used it but still not working.

Here is how it looks like in my application (using google chrome)

Here is how I have formatted in the report.

And what I get from the report as a PDF file.

I have attached the report zip file in case you want to have a look.
Report for entity Job Profile.zip (13.6 KB)

And here is the screen XML related to the RichTextArea

                            <richTextArea id="responsibilityAndSpecsField" property="responsibilityAndSpecs" colspan="4" htmlSanitizerEnabled="true"
                                          width="100%" rowspan="6"/>

I am using the latest version of CUBA platform and add-on as of today (v7.2.13).

You should set here name of your report band:
image

here is an example how it should be implemented:
NewEntity is a name of report band in my case
image

More information about value field formats

Regards,
Nadezhda.

Hi @n.shatalova
That’s great! I have used that prefix and now it is improved a bit but still needs some improvement. Here is details:

  1. New paragraph is created, HTML markup codes gone away. good

However, still having the following issues:
2) New paragraph does not have space from the previous paragraph when I have a single space. As a work-around, I have used double space from the previous paragraph, it’s now showing 1 line space.
3) There is no bullet or numbering formatting in the report. see below

What I have in editor

What I get from report

  1. I tried to use colour and others formatting, it does not work. All I can do is, set the font size and bold/normal. I tried in both google chrome and Safari. Firefox is even worst, inactive for editing with RichTextField.

Hi.

You have already asked these questions in another topic. It’s known issue and now you can use HTML report format with PDF output format to avoid these problems.

Regards,
Nadezhda.

Hi
Thanks for the link, I hope this problem is be resolved soon.

I have tried HTML template but getting different type of error:

com.haulmont.reports.exception.ReportingException: . Template name [Template for report “Report for entity “Job Profile””.html] Report name [Report for entity “Job Profile” (2)]
Can’t load the XML resource (using TrAX transformer). org.xml.sax.SAXParseException; lineNumber: 23; columnNumber: 90; The entity name must immediately follow the ‘&’ in the entity reference.
org.xml.sax.SAXParseException; lineNumber: 23; columnNumber: 90; The entity name must immediately follow the ‘&’ in the entity reference.
The entity name must immediately follow the ‘&’ in the entity reference.
at com.haulmont.reports.ReportingBean.createReportDocumentInternal(ReportingBean.java:407)
at com.haulmont.reports.ReportingBean.createReportDocument(ReportingBean.java:330)
at com.haulmont.reports.ReportingBean.createReport(ReportingBean.java:214)
at com.haulmont.reports.ReportServiceBean.createReport(ReportServiceBean.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:90)
at jdk.internal.reflect.GeneratedMethodAccessor2744.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy2571.createReport(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:94)
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:159)
at com.sun.proxy.$Proxy2692.createReport(Unknown Source)
at com.haulmont.reports.gui.ReportGuiManager.getReportResult(ReportGuiManager.java:286)
at com.haulmont.reports.gui.ReportGuiManager.printReportSync(ReportGuiManager.java:257)
at com.haulmont.reports.gui.ReportGuiManager.printReport(ReportGuiManager.java:226)
at com.haulmont.reports.gui.report.run.InputParametersWindow.printReport(InputParametersWindow.java:114)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.haulmont.cuba.gui.xml.DeclarativeAction.actionPerform(DeclarativeAction.java:101)
at com.haulmont.cuba.web.gui.components.WebButton.buttonClicked(WebButton.java:67)
at com.haulmont.cuba.web.widgets.CubaButton.fireClick(CubaButton.java:76)
at com.vaadin.ui.Button$1.click(Button.java:57)
at jdk.internal.reflect.GeneratedMethodAccessor2930.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:153)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:115)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:431)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:396)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:260)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:82)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1578)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108)
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:93)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at com.haulmont.cuba.web.sys.singleapp.SingleAppWebContextLoader$SetClassLoaderFilter.doFilter(SingleAppWebContextLoader.java:236)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)

Check if you doesn’t use unescaped ‘&’ in your text as described here

Sorry, not sure I understood. I am not creating those codes manually, all auto generated in CUBA. Therefore, no ideas what and where to fix and would appreciate guiding which types of template would work in reports for RichTextArea.

Unfortunately, we cannot reproduce the problem. We will be able to help you if you send us a small sample project along with a reproduction scenario that demonstrates the issue.

Regards,
Nadezhda.