Crystal Reports 剪切 PDF 中的文本

发布于 2024-08-24 10:30:55 字数 496 浏览 7 评论 0原文

我在 Crystal Reports Cutting Off Text in PDF 上找到了这篇文章,但它并没有解决我的问题。

我有一个水晶报表,其中包含文本对象内的字段(用于控制行间距)并选择了“可以增长”。当我将 Crystal Report 导出为 PDF 时,有时会出现文本被截断的情况。

在此处输入图像描述

在此示例中,文本在右侧被截断,但在某些情况下,当文本由多行组成,最后一行的底部将被部分切除。

我使用的是与 Visual Studio 2008 捆绑在一起的 Crystal Reports。文本区域已选中“可以增长”,字体设置为 Helvetica LT Condensed,粗体 14,行距设置为正常值的 0.75 倍。

有人对如何解决这个问题有任何想法吗?

I found this post on Crystal Reports Cutting Off Text in PDF, but it didn't solve my problem.

I have a Crystal Report that contains a field within a text object (to control line spacing) and has "can grow" selected. When I export the Crystal Report to a PDF there are instances when the text is cut off.

enter image description here

In this example the text is being cut off on the right side, but in some cases, when the text consists of many lines, the bottom part of the last line will be partially cut off.

I am using Crystal Reports that is bundled with Visual Studio 2008. The text area has "can grow" checked, the font is set to Helvetica LT Condensed, bold 14, and the line spacing is set to 0.75 times normal.

Anyone have any thoughts on how can I fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

維他命╮ 2024-08-31 10:30:56

我也遇到过这个问题 - Crystal 似乎对文本框边框的位置有点困惑。我建议在文本框中添加一个小的右缩进(右键单击文本框,选择“设置对象格式”,选择“段落”选项卡,然后在右侧文本框中输入小数字(可能是 0.2 左右)。这 至于右边距

,您可以在文本末尾添加换行符,因为它来自数据库,或者您可以尝试使用公式。添加换行符的字段:

{table_name.field_name} + chr(13) + chr(10)

I have run into this as well - Crystal seems a little confused about where the text box borders are. I suggest adding a small right indent to the text box (right click on the text box, select 'Format Object', select the 'Paragraph' tab, and enter small numbers (maybe .2 or so) into the Right text box. This should help with the right margin.

As for the bottom cut-off, there is no margin that you can add. Can you add a line break to the end of your text as it comes from the db? Or, you could try a formula field to add the line break:

{table_name.field_name} + chr(13) + chr(10)
小嗲 2024-08-31 10:30:56
  • 右键单击文本字段
  • 选择通用选项卡
  • 在水平对齐部分我将其更改为“对齐”。

这会将文本调整为适当的跨度,并且在使用“Can Grow”时不会过早地被切断。

  • Right click on the text field
  • Select Common Tab
  • In the Horizontal Alignment section I changed it to "Justified".

This adjusted the text to span properly and not cut off prematurely when using Can Grow.

栖迟 2024-08-31 10:30:56

我想我已经发现问题了。边界子报表宽度小于字段对象的宽度。调整其宽度修复了右侧发生的截断。

顺便说一句,底部的文本被截断似乎是由于将行距调整得太小而导致的。如果将行间距设置为原始文本磅值的倍数并使其太小,则该行的底部部分会被截断。我将其更改为“精确”并输入了特定的磅值(例如,我的 16 磅文本的行距为 18 磅),这似乎解决了问题。如果行间距太小,水晶似乎会遮盖文本的底部部分。

I think I've found out the problem. The bounding subreport width was smaller than the width of the field object. Adjusting it's width fixed the truncation occurring on the right-hand side.

On a side note, text being truncated on the bottom seems to be a result of adjusting the line-spacing too small. if you set the line spacing as a multiple of the original text point size and make it too small, the bottom part of the line is truncated. I changed this to "exact" and entered a specific point size (e.g line spacing of 18 pt. for my 16 pt. text) and this seemed to solve the problem. If the line spacing is too small it seems that Crystal masks off the bottom part of the text.

棒棒糖 2024-08-31 10:30:56

我尝试了这个,它解决了这个问题。

尝试执行以下操作:

文本对象>右键单击>设置文本格式>边框选项卡

更改线条样式:右/左/上/下为单一线条并将颜色更改为白色。

I tried this and it solved this issue.

Try to do following :

Text Object > Right Click > Format Text > Border Tab

Change Line Style : Right/Left/Top/Bottom as single and change color to White.

困倦 2024-08-31 10:30:56

我在更新存储过程时遇到了这个问题。我将拉入报告的“描述”字段从 VARCHAR(100) 更改为内联请求的更改的 VARCHAR(150)。预览模式下的 Crystal 报表存储了 100 个字符的旧限制,并且正在截断标签。当我再次验证数据库时,这个问题得到了纠正。

数据库选项卡 ->验证数据库

I experienced this problem when I updated a Stored procedure. I changed the Description field that I was pulling onto the report from a VARCHAR(100) to a VARCHAR(150) inline with a requested change. The Crystal report in preview mode had stored old limit of 100 characters and was truncating the label. This was rectified when I verified the database again.

Database Tab -> Verify Database

Bonjour°[大白 2024-08-31 10:30:56

我也发现了这一点。只发生在 HTML 视图中。我做了一些事情,对于 3 个区块,我需要做不同的事情,并尝试了多种场景来选择最好的方案。
- 将文本格式设置为从左对齐到右对齐
- 抓住文本框的右边缘并将其从右边缘拉出一个勾
- 将字体从 Times New Roman 切换为另一种(奇怪)
- 从 BI LP 导出为 CR RPT,并从 CR 2013 客户端导出为 PDF
- 更改字体大小 - 我们有一个“和/或”中线,并将其更改为“和/或”

我们采用合理的对齐方式,因为它接近整条线,并且看起来与原始线没有什么不同。

许多奇怪的解决方法都纠正了它。对我来说,这表明报告中存在系统升级故障。

希望我的发现可以帮助其他人。

I too discovered this too. Only happened in HTML view. I did a few things which for 3 blocks I needed to do different and tried numerous scenarios to choose the best to go with.
- Format text from left justufied to justified
- Grip the right edge of the text box and pulled it in a tick from the right margin
- Switched the font from Times New Roman to another (wierd)
- Exporting from BI LP as a CR RPT and exported from the CR 2013 client to PDF
- Change font size - We had an "and / or" midline and changed it to "and/or"

We went with the justified alignment since it was close to a full line and didn't look different than original.

Lots of wierd workarounds that rectified it. To me, it's indicating a system upgrade glitch in the report.

Hope what I found helps others.

浴红衣 2024-08-31 10:30:56

如果您尝试了所有方法仍然无效,您可以尝试以下方法:

     Local StringVar inString := 'Your text string here.......';

     Local NumberVar strLen := Length (inString);
     Local StringVar result := "";
     Local NumberVar maxLen := 45;    // adjust the length of text per line
     Local NumberVar idx := 0;
     Local NumberVar proceed := 0;

     While strLen > maxLen Do
     (
      proceed := 1;
      idx := maxLen;
      While (mid(inString,idx,1) <> " "  and idx > 1) Do
      (
       idx := idx -1;
       );
      if (idx = 1) then 
             result := result + mid(inString,1,maxlen) + chr(10)
      else
         (
             result := result + mid(inString, 1, idx-1)+ chr(10);
             strLen := strLen-idx;
             inString := mid(inString, idx+1, strLen)
         )
      );

     if proceed = 1 then
      (
        result := result + inString
       )
      else
       (
       result := inString
     );
  result

If you tried all the methods and still not working, you can try the following:

     Local StringVar inString := 'Your text string here.......';

     Local NumberVar strLen := Length (inString);
     Local StringVar result := "";
     Local NumberVar maxLen := 45;    // adjust the length of text per line
     Local NumberVar idx := 0;
     Local NumberVar proceed := 0;

     While strLen > maxLen Do
     (
      proceed := 1;
      idx := maxLen;
      While (mid(inString,idx,1) <> " "  and idx > 1) Do
      (
       idx := idx -1;
       );
      if (idx = 1) then 
             result := result + mid(inString,1,maxlen) + chr(10)
      else
         (
             result := result + mid(inString, 1, idx-1)+ chr(10);
             strLen := strLen-idx;
             inString := mid(inString, idx+1, strLen)
         )
      );

     if proceed = 1 then
      (
        result := result + inString
       )
      else
       (
       result := inString
     );
  result
背叛残局 2024-08-31 10:30:56

在有 Crystal Reports 的环境下,设置注册表项对我们有帮助:ForceLargerFonts = 0

如何查找?

对于 64 位版本的 MS Windows:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Export\PDF

对于 32 位版本的 MS Windows:
HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Export\PDF

另请参阅以下解决方案:
https://apps.support.sap.com/sap/支持/知识/公共/en/0001835763

In one environment with Crystal Reports it was a help for us to set the registry key: ForceLargerFonts = 0

How to find?

For 64 bit version of MS Windows:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Export\PDF

For 32 bit version of MS Windows:
HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Export\PDF

Please see also the following solution at
https://apps.support.sap.com/sap/support/knowledge/public/en/0001835763

清浅ˋ旧时光 2024-08-31 10:30:56

这是一个难题,您必须从 3 个不同的方面来解决:

  1. 软件修补程序
  2. 默认打印机
  3. 表单创作

软件修补程序:您需要下载包含修补程序 20 的 CRRuntime。此修补程序解决了制作 PDF 时的截断问题。您可以在 http://downloads.businessobjects.com/akdlm/crnetruntime 找到它/clickonce/CRRuntime_64bit_13_0_20.msi

默认打印机: 编写报表时使用的打印机必须与您渲染报表的打印机相匹配。在我们的服务器上,除了 Microsoft XPS Document Writer 之外,没有安装任何打印机。编写报告时,请务必选择该打印机作为默认打印机。

表单创作:将数据库字段添加到报表时,请勿将其从字段资源管理器拖到设计图面上。首先将文本对象插入到设计图面上。按照您喜欢的方式放置文本对象并调整其大小后,将数据库字段拖到文本对象上。您将看到大括号中的数据库项目名称出现在文本对象中。无论出于何种原因,当数据库字段被文本对象包围时,它会更好地换行。

This is a difficult problem that you have to attack from 3 different fronts:

  1. Software Hot Fix
  2. Default Printer
  3. Form Authoring

Software Hot Fix: You'll need to download the CRRuntime that includes Hot Fix 20. This Hot Fix addresses truncation problems when making a PDF. You can find it at http://downloads.businessobjects.com/akdlm/crnetruntime/clickonce/CRRuntime_64bit_13_0_20.msi

Default Printer: The printer you use when authoring a report must match a printer where you are rendering a report. On our servers, there are no printers installed except the Microsoft XPS Document Writer. Be sure to select that as you default printer when writing the report.

Form Authoring: When you add a database field to your report, don't drag it from the field explorer onto the design surface. First insert a text object onto the design surface. When you've positioned and resized the Text Object the way you like it, drag the database field onto the Text Object. You'll see the name of the database item in curly braces appear in the Text Object. For whatever reason, the database field will wrap better when it is enclosed by a Text Object.

戈亓 2024-08-31 10:30:56

这让我整个晚上都感到压力很大!
对我有用的是:
如果您使用带有数据集的水晶报表(链接到数据集),很可能您更改了数据库中字段的长度。因此,如果长度为 10 并且您调整为 20,则无论您做什么,报告都会读取字段长度为 10 个字符的“旧”数据集,并将其截断为 10(我不知道为什么会这样做)那)...不管你信不信,我只是从我的“旧”数据集中复制了查询,创建了一个新的数据集,瞧!它就像魅力一样起作用......

This got me literally stressed for a whole night!!
What worked for me was this:
if you are using crystal reports with dataset (linked to a dataset),most likely you changed the length of the field in the database. so if the length was 10 and you adjust to 20 for instance, no matter what you do, the report is reading the "Old" dataset with the field of length 10 characters and truncating it at 10 (I don't know why it did that)...believe it or not I just copied the query from my "Old" dataset,created a new dataset and VOILA!!! it worked like charm...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文