Crystal Reports:传递多行参数值

Crystal Reports: Passing Multiline Parameter Values(Crystal Reports:传递多行参数值)

本文介绍了Crystal Reports:传递多行参数值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想像这样将一些参数传递给 Crystal Report:

I want to pass some parameters to a Crystal Report like this:

ReportDocument.DataDefinition.FormulaFields[parameterName].Text   = 'Text';

这很好用,除非我想从 ASPX 传递一个多行文本框(包含 和 字符.)

This workes fine unless I want to pass a multiline textbox from ASPX (containing and chars.)

reportviewer 报告缺少与此字符串匹配的 '.".

The reportviewer reports that "The matching ' for this string is missing.".

是否有任何示例/列表/建议如何解析(多行)文本和完成这项工作?

Is there any example/list/suggestion how to parse the (multiline) text and make this work?

谢谢,

斯特凡

推荐答案

如果你想保留换行符,你应该用 sindre j 描述的一些模糊的东西替换它们.为了使换行符在 Crystal Reports 中正确显示,您需要将 Crystal Report 公式中的晦涩字符替换为 html 换行符.然后将公式字段添加到报告中并右键单击,选择格式字段",选择段落"选项卡,并将文本解释"更改为HTML 文本".您还需要确保在通用"选项卡上选中可以增长"属性.请参见下面的示例公式:

If you want to retain line breaks you should replace them with something obscure as described by sindre j. In order for the line breaks to display correctly in Crystal Reports you need to replace the obscure characters in a Crystal Report formula with html breaks. Then add your formula field to the report and right-click, select 'Format Field', select the 'Paragraph' tab, and change the 'Text Interpretation' to 'HTML Text'. You also need to make sure the 'Can Grow' attribute is checked on the 'Common' tab. See the example formula below:

<代码>"<html>"+ 替换({?ParameterField}, "___", "<br>") + "<html/>"

希望这会有所帮助.

这篇关于Crystal Reports:传递多行参数值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Crystal Reports:传递多行参数值

基础教程推荐