问题描述
我有一个自定义屏幕,其中包含一个详细信息"富文本区域,该区域允许将文本显示为 HTML、纯文本等.
I have a custom screen which contains a 'Details' Rich Text area that allows text to be shown as HTML, Plain Text, etc.
我还有一个请求,希望能够以某种方式在 Acumatica 报告中显示该数据.不幸的是,即使选择了纯文本"选项,它在数据库字段中仍然有格式标签.Acumatica 报告编写器中是否有一种字段类型可以解释来自该类型富文本字段的数据?
I also have a request to somehow be able to show that data on an Acumatica report. Unfortunately, even if the option for 'Plain Text' is selected, it still has formatting tags in the database field. Is there a type of field in the Acumatica report writer that can interpret data from that type of Rich Text field?
推荐答案
不,在将富文本框控件添加到报表设计器之前,这是不可能的.
No it is not really possible until a rich text box control is added to the report designer.
Acumatica 网页中的富文本控件主要是 HTML.
The rich text control in Acumatica web page is mostly HTML.
如果您从 VISUAL
更改为 HTML
,您可以获得 HTML 代码.
If you change from VISUAL
to HTML
you can get the HTML code.
如果您非常有动力,可以尝试 破解报告中的 HTML.这是一个非常糟糕的主意,但我设法欺骗了设计师接受 HTML 内容作为导航 URL 链接内容.
If you are very motivated you can attempt to hack the HTML in the report. It's a very bad idea but I managed to fool the designer into accepting HTML content as the navigate URL link content.
当报表以 HTML 模式呈现时,链接控件继承了链接样式之上的一些 HTML 样式.这是愚蠢且无用的,但演示了在 Acumatica 报表设计器中实现富文本编辑器控件所需的底层机制.
When the report is rendered in HTML mode the link control inherits some of the HTML styles on top of the link style. It's silly and useless but demonstrate the underlaying mechanisms needed to make rich text editor control happen in Acumatica report designer.
另一种方法是创建一个提取纯文本的自定义字段:
The alternative is to create a custom field that extracts the plain text:
#region DescriptionAsPlainText
public abstract class descriptionAsPlainText : PX.Data.BQL.BqlString.Field<descriptionAsPlainText> { }
private string _plainText;
[PXString(IsUnicode = true)]
[PXUIField(Visible = false)]
public virtual String DescriptionAsPlainText
{
get
{
return _plainText ?? (_plainText = PX.Data.Search.SearchService.Html2PlainText(this.Description));
}
}
#endregion
这篇关于是否可以从富文本控件中获取数据并将其显示在 Acumatica 报告中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!