从 Microsoft.ReportViewer.LocalReport 导出的 PDF 中渲染条形码

Rendering barcodes in PDF export from Microsoft.ReportViewer.LocalReport

我正在使用 Microsoft.Reporting.WebForms 命名空间并尝试从我的 localreport 对象呈现数据以便在客户端打印。

byte[] bytes = myReportViewer.LocalReport.Render("PDF");
File.WriteAllBytes("test.pdf", bytes); // I will normally return bytes here but for testing I am writing to a file

输出的 pdf 文件显示的是小方框而不是条形码。 pdf好像不支持code128字体。

我尝试过的事情:

PS:

客户端的内置 exportReport method 导出 pdf 时带有清晰的条形码。但我正在尝试呈现数据并将其 return 作为字节数组。我无法弄清楚这种客户端方法和服务器端渲染方法之间的区别。他们使用不同的逻辑吗?

如果你能指导我一些方向,我将不胜感激。

谢谢。

这似乎是 Microsoft Reporting Services 10.0.0 的一个已知错误。经过多次谷歌搜索后,我停下来检查了我的参考文件。事实证明,我引用的是 Microsoft.Reporting.WebForms 的第 10 版,尽管在我的其他工作项目中它是第 11 版。 因此,如果有人遇到同样的问题,请确保您使用的不是版本 10 的 dll 文件。