Bug 329430

Summary: Description fields outputs html tags when used in Reports
Product: [Applications] calligraplan Reporter: Alvaro Soliverez <asoliverez>
Component: generalAssignee: Friedrich W. H. Kossebau <kossebau>
Status: RESOLVED FIXED    
Severity: normal CC: dag.andersen
Priority: NOR    
Version First Reported In: 2.7.5   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 3.0
Sentry Crash Report:

Description Alvaro Soliverez 2013-12-30 14:08:55 UTC
When I try to use the Description field in a report, it outputs html and other tags.

It should use those tags for formatting and not display them on the report.

Also, there is no way to really clear the field without editing it directly. Any new task description is saved as:

description="&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;>&#xa;&lt;html>&lt;head>&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; />&lt;style type=&quot;text/css&quot;>&#xa;p, li { white-space: pre-wrap; }&#xa;&lt;/style>&lt;/head>&lt;body style=&quot; font-family:'Oxygen-Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;>&#xa;&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'OxygenSans';&quot;>&lt;br />&lt;/p>&lt;/body>&lt;/html>"

Reproducible: Always
Comment 1 Alvaro Soliverez 2013-12-30 15:07:16 UTC
Having a second look at it, it seems to be replacing the first < before DOCTYPE, therefore it doesn't recognize the rest as tags, hence the raw output.
Comment 2 Dag Andersen 2016-08-25 14:45:39 UTC
KReport field and text items does not know about rich text.
You can use the web item to display rich text-
Comment 3 Alvaro Soliverez 2016-08-25 19:36:34 UTC
I don't think you understand. It's not that I intended to output html.

Any new task that I create will output these tags, instead of a clean text.
Comment 4 Dag Andersen 2016-08-26 07:10:17 UTC
Sorry, didn't check properly before answering.

Description is rich text, wether you intend it or not :)

The problem is that the report designers tools you normally use for outputting text:
"Field" and "Text" does not support rich text.
I checked 2.9.7 now and find that the report engine as removed the tool that *could* handle rich text (sigh) so atm there is no way to include description in reports.

We are working on 3.0, but I think a fix has to wait for 3.1.
Comment 5 Dag Andersen 2016-08-30 12:57:27 UTC
Git commit b6bd4b9bfea7b414c4df549272f4cf4ec249b9f8 by Dag Andersen.
Committed on 30/08/2016 at 12:52.
Pushed by danders into branch 'master'.

Plan: Re-instate handling richtext (description) in reports

Partial solution, outputs text as plain text.

M  +1    -1    plan/libs/ui/CMakeLists.txt
A  +5    -0    plan/libs/ui/reports/items/CMakeLists.txt
A  +28   -0    plan/libs/ui/reports/items/text/CMakeLists.txt
A  +183  -0    plan/libs/ui/reports/items/text/PlanReportDesignerItemRichText.cpp     [License: LGPL (v2.1+)]
A  +53   -0    plan/libs/ui/reports/items/text/PlanReportDesignerItemRichText.h     [License: LGPL (v2.1+)]
A  +330  -0    plan/libs/ui/reports/items/text/PlanReportItemRichText.cpp     [License: LGPL (v2.1+)]
A  +85   -0    plan/libs/ui/reports/items/text/PlanReportItemRichText.h     [License: LGPL (v2.1+)]
A  +71   -0    plan/libs/ui/reports/items/text/PlanReportRichTextPlugin.cpp     [License: LGPL (v2.1+)]
A  +40   -0    plan/libs/ui/reports/items/text/PlanReportRichTextPlugin.h     [License: LGPL (v2.1+)]
A  +205  -0    plan/libs/ui/reports/items/text/PlanReportScriptRichText.cpp     [License: LGPL (v2.1+)]
A  +105  -0    plan/libs/ui/reports/items/text/PlanReportScriptRichText.h     [License: LGPL (v2.1+)]
A  +28   -0    plan/libs/ui/reports/items/text/richtext.json
M  +34   -24   plan/libs/ui/reports/reportview.cpp

http://commits.kde.org/calligra/b6bd4b9bfea7b414c4df549272f4cf4ec249b9f8