SQL Server 2005 Reporting Services中的自定义字体

时间:2021-07-21 08:08:30

I'm having issues with my SQL Reporting Services reports. I'm using a custom font for report headers, and when deployed to the server it does not render correctly when I print or export to PDF/TIFF. I have installed the font on the server. Is there anything else I need to do in order to use custom fonts?

我的SQL Reporting Services报告存在问题。我正在为报表标题使用自定义字体,当部署到服务器时,它在打印或导出到PDF / TIFF时无法正确呈现。我在服务器上安装了字体。为了使用自定义字体,还有什么我需要做的吗?

When viewing the font in the browser it looks correct - since all client computers have the font installed...

在浏览器中查看字体时,它看起来是正确的 - 因为所有客户端计算机都安装了字体...


Thanks Ryan, your post to the FAQ solved the problem. Installing the fonts on the server fixes the print problem, as well as problems with charts (which are also rendered on the server). Like you point out (as well as being mentioned in the FAQ) Reporting Services 2005 does not do font embedding in PDF files. I guess that is okay for now - the most important part was being able to hit print and get the correct fonts.

谢谢Ryan,你在FAQ上的帖子解决了这个问题。在服务器上安装字体可以解决打印问题以及图表问题(也可以在服务器上呈现)。就像你指出的那样(以及FAQ中提到的)Reporting Services 2005不会在PDF文件中进行字体嵌入。我想现在还可以 - 最重要的部分是能够打印并获得正确的字体。

The reason the fonts didn't show up straight away is answered in the FAQ:

字体未直接显示的原因在常见问题解答中得到了解答:

Q: I've installed the font on my client/server but I still see ?'s or black boxes. Why? A: For the client machine, closing all instances of the PDF viewer then reopening them should fix the issue.

问:我已经在我的客户端/服务器上安装了该字体,但我仍然看到了?或黑盒子。为什么?答:对于客户端计算机,关闭PDF查看器的所有实例然后重新打开它们应该可以解决问题。

For the server, restarting the services should allow the PDF renderer to pick up the new font information.

对于服务器,重新启动服务应允许PDF呈现器获取新的字体信息。

Unfortunately, I have also seen times where I needed a full machine reboot to get the client/server to recognize the newly installed font.

不幸的是,我还看到过需要重启整机才能让客户端/服务器识别新安装的字体的时间。

5 个解决方案

#1


4  

The PDF files served up from SSRS, like many PDF files, have embedded postscript fonts. So, the local fonts used in the report are converted to a best matching postscript font when the conversion takes place so the PDF is totally portable without relying on locally installed fonts.

与许多PDF文件一样,SSRS提供的PDF文件具有嵌入的postscript字体。因此,当转换发生时,报表中使用的本地字体将转换为最匹配的postscript字体,因此PDF完全可移植而不依赖于本地安装的字体。

You can see the official MS guidelines and font requirements for SSRS PDF exports here: SQL Server 2005 Books Online (September 2007) Designing for PDF Output. Also, this post should provide some help as well: Reporting Services: PDF Renderer FAQ

您可以在此处查看SSRS PDF导出的官方MS准则和字体要求:SQL Server 2005联机丛书(2007年9月)设计PDF输出。此外,这篇文章也应该提供一些帮助:Reporting Services:PDF Renderer FAQ


Aspose apparently also has a component that claims to be able to add custom embedded fonts in SQL Report PDFs.

Aspose显然也有一个声称能够在SQL Report PDF中添加自定义嵌入字体的组件。

See Aspose.Pdf for Reporting Services

请参阅Aspose.Pdf for Reporting Services

Aspose.Pdf for Reporting Services makes it possible generating PDF reports in Microsoft SQL Server 2000 and 2005 Reporting Services. Some advanced features like XMP metadata, custom embedded font and rendering watermark for pages are now supported. All RDL report features including sections, images, charts, tables, matrices, headers and footers are converted with the highest degree of precision to PDF.

Aspose.Pdf for Reporting Services可以在Microsoft SQL Server 2000和2005 Reporting Services中生成PDF报告。现在支持一些高级功能,如XMP元数据,自定义嵌入字体和页面渲染水印。所有RDL报告功能(包括剖面,图像,图表,表格,矩阵,页眉和页脚)都以最高精度转换为PDF。

I've not tried this component, so I can only share what it claims to be able to do.

我没有试过这个组件,所以我只能分享它声称可以做的事情。

#2


3  

Note: I have found that when you install the fonts on the Reporting Services server box, you may need to:

注意:我发现在Reporting Services服务器上安装字体时,您可能需要:

= Actually open the font from the Fonts control panel, so you can see the preview

=实际上从字体控制面板打开字体,以便您可以看到预览

AND

= Reboot the server box.

=重新启动服务器框。

And yes, I agree you should not need to do this - but I have seen it work.

是的,我同意你不应该这样做 - 但我看到它有效。

#3


1  

Running into the same problem - When you export to pdf, it doesn't render the Free 3 of 9 font. The font is installed on my report server, and does appear when you run the report using SSRS 2005.

遇到同样的问题 - 导出为pdf时,它不会呈现Free 3 of 9字体。该字体安装在我的报表服务器上,并在使用SSRS 2005运行报表时显示。

The user can print directly, which is nice. And the report renders successfully during an Excel export. But that requires extra steps to print from Excel (page setup, etc.).

用户可以直接打印,这很好。并且报告在Excel导出期间成功呈现。但这需要额外的步骤从Excel打印(页面设置等)。

What I found to be a workaround is to use CutePDF (freeware).

我发现解决方法是使用CutePDF(免费软件)。

Just click the direct print button on SSRS, and choose the CutePDF printer. It asks you where to save the file. Open the file, and the barcode fonts render successfully.

只需单击SSRS上的直接打印按钮,然后选择CutePDF打印机。它会询问您保存文件的位置。打开文件,条形码字体成功呈现。

#4


0  

We had to install NeoDynamic barcode software to render the barcode as an image since we can't include the barcode fonts in PDF exports.

我们必须安装NeoDynamic条形码软件才能将条形码渲染为图像,因为我们不能在PDF导出中包含条形码字体。

#5


0  

I have used barcode fonts successfully with SSRS and PDF. You must have the font installed on both the server (for rendering and viewing from the browser), as well as from the client.

我已成功使用条形码字体与SSRS和PDF。您必须在服务器上(用于从浏览器呈现和查看)以及从客户端安装字体。

When using barcode fonts, there's not really a best "match" for postscript so the PDF does not have a valid barcode font embedded with the document, which just yieds a bunch of garbage text. To solve that, just install the font on the client computer that will view the PDF.

当使用条形码字体时,对于postscript来说并不是最好的“匹配”,因此PDF没有嵌入文档的有效条形码字体,这只是一堆垃圾文本。要解决此问题,只需在将查看PDF的客户端计算机上安装该字体即可。

#1


4  

The PDF files served up from SSRS, like many PDF files, have embedded postscript fonts. So, the local fonts used in the report are converted to a best matching postscript font when the conversion takes place so the PDF is totally portable without relying on locally installed fonts.

与许多PDF文件一样,SSRS提供的PDF文件具有嵌入的postscript字体。因此,当转换发生时,报表中使用的本地字体将转换为最匹配的postscript字体,因此PDF完全可移植而不依赖于本地安装的字体。

You can see the official MS guidelines and font requirements for SSRS PDF exports here: SQL Server 2005 Books Online (September 2007) Designing for PDF Output. Also, this post should provide some help as well: Reporting Services: PDF Renderer FAQ

您可以在此处查看SSRS PDF导出的官方MS准则和字体要求:SQL Server 2005联机丛书(2007年9月)设计PDF输出。此外,这篇文章也应该提供一些帮助:Reporting Services:PDF Renderer FAQ


Aspose apparently also has a component that claims to be able to add custom embedded fonts in SQL Report PDFs.

Aspose显然也有一个声称能够在SQL Report PDF中添加自定义嵌入字体的组件。

See Aspose.Pdf for Reporting Services

请参阅Aspose.Pdf for Reporting Services

Aspose.Pdf for Reporting Services makes it possible generating PDF reports in Microsoft SQL Server 2000 and 2005 Reporting Services. Some advanced features like XMP metadata, custom embedded font and rendering watermark for pages are now supported. All RDL report features including sections, images, charts, tables, matrices, headers and footers are converted with the highest degree of precision to PDF.

Aspose.Pdf for Reporting Services可以在Microsoft SQL Server 2000和2005 Reporting Services中生成PDF报告。现在支持一些高级功能,如XMP元数据,自定义嵌入字体和页面渲染水印。所有RDL报告功能(包括剖面,图像,图表,表格,矩阵,页眉和页脚)都以最高精度转换为PDF。

I've not tried this component, so I can only share what it claims to be able to do.

我没有试过这个组件,所以我只能分享它声称可以做的事情。

#2


3  

Note: I have found that when you install the fonts on the Reporting Services server box, you may need to:

注意:我发现在Reporting Services服务器上安装字体时,您可能需要:

= Actually open the font from the Fonts control panel, so you can see the preview

=实际上从字体控制面板打开字体,以便您可以看到预览

AND

= Reboot the server box.

=重新启动服务器框。

And yes, I agree you should not need to do this - but I have seen it work.

是的,我同意你不应该这样做 - 但我看到它有效。

#3


1  

Running into the same problem - When you export to pdf, it doesn't render the Free 3 of 9 font. The font is installed on my report server, and does appear when you run the report using SSRS 2005.

遇到同样的问题 - 导出为pdf时,它不会呈现Free 3 of 9字体。该字体安装在我的报表服务器上,并在使用SSRS 2005运行报表时显示。

The user can print directly, which is nice. And the report renders successfully during an Excel export. But that requires extra steps to print from Excel (page setup, etc.).

用户可以直接打印,这很好。并且报告在Excel导出期间成功呈现。但这需要额外的步骤从Excel打印(页面设置等)。

What I found to be a workaround is to use CutePDF (freeware).

我发现解决方法是使用CutePDF(免费软件)。

Just click the direct print button on SSRS, and choose the CutePDF printer. It asks you where to save the file. Open the file, and the barcode fonts render successfully.

只需单击SSRS上的直接打印按钮,然后选择CutePDF打印机。它会询问您保存文件的位置。打开文件,条形码字体成功呈现。

#4


0  

We had to install NeoDynamic barcode software to render the barcode as an image since we can't include the barcode fonts in PDF exports.

我们必须安装NeoDynamic条形码软件才能将条形码渲染为图像,因为我们不能在PDF导出中包含条形码字体。

#5


0  

I have used barcode fonts successfully with SSRS and PDF. You must have the font installed on both the server (for rendering and viewing from the browser), as well as from the client.

我已成功使用条形码字体与SSRS和PDF。您必须在服务器上(用于从浏览器呈现和查看)以及从客户端安装字体。

When using barcode fonts, there's not really a best "match" for postscript so the PDF does not have a valid barcode font embedded with the document, which just yieds a bunch of garbage text. To solve that, just install the font on the client computer that will view the PDF.

当使用条形码字体时,对于postscript来说并不是最好的“匹配”,因此PDF没有嵌入文档的有效条形码字体,这只是一堆垃圾文本。要解决此问题,只需在将查看PDF的客户端计算机上安装该字体即可。