[英]Rendering barcodes in PDF export from Microsoft.ReportViewer.LocalReport
I am using Microsoft.Reporting.WebForms
namespace and trying to render the data from my localreport object for printing purposes on the client side. 我正在使用
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
The output pdf file is displaying little boxes instead of barcodes. 输出pdf文件显示的是小方框而不是条形码。 It appears that pdf can't support code128 font.
看来pdf不能支持code128字体。
The built in exportReport method from the client side exports the pdf perfectly with sharp barcodes. 来自客户端的内置exportReport方法使用尖锐的条形码完美地导出pdf。 But I am trying to render the data and return it as byte array.
但我试图渲染数据并将其作为字节数组返回。 I couldn't figure out the difference between this client side method and server side render method.
我无法弄清楚这个客户端方法和服务器端渲染方法之间的区别。 Do they use different logic?
他们使用不同的逻辑吗?
I would appreciate if you can direct me in some direction. 如果你能指导我某个方向,我将不胜感激。
Thanks. 谢谢。
It seems that this was a known bug with Microsoft Reporting Services 10.0.0. 这似乎是Microsoft Reporting Services 10.0.0的一个已知错误。 After much googling, I stopped and checked my referenced files.
经过大量的谷歌搜索,我停下来检查我的引用文件。 It turns out that I was referencing version 10 of
Microsoft.Reporting.WebForms
although in my other project that worked it was version 11. So if anyone runs into the same problem, just make sure that you are not using the version 10 dll files. 事实证明,我正在引用
Microsoft.Reporting.WebForms
第10版,尽管在我的其他项目中它是版本11.因此,如果有人遇到同样的问题,请确保您没有使用版本10 dll文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.