Unicode字符在RDLC报告中未在ASP.NET Core 5中的PDF中打印

发布于 2025-01-28 21:06:58 字数 945 浏览 3 评论 0原文

开发人员,我面临一个简单的问题,但我无法弄清楚实际原因。 我的ASP.NET Core 5和Angular 12项目中有很多报告。除了 unicode字符外,所有内容都正确渲染。

请参见下面的代码示例。

public static void Load(LocalReport report, decimal widgetPrice, decimal gizmoPrice) 
{ 
var items = new[] 
{ 
new ReportItem { Description = "Widget 6000 আমাদের A দেশের নাম বাংলাদেশ", Price = widgetPrice, Qty = 1 },
new ReportItem { Description = "Gizmo MAX", Price = gizmoPrice, Qty = 25 } 
};
var parameters = new[] { new ReportParameter("Title", "Invoice 4/2020") };
using var rs = Assembly.GetExecutingAssembly()
.GetManifestResourceStream("ReportViewerCore.Sample.AspNetCore.Reports.Report.rdlc");
report.LoadReportDefinition(rs); report.DataSources.Add(new ReportDataSource("Items", items));
report.SetParameters(parameters);
}

在第一个ReportItem.Description =“ Widge 6000 +我的语言中的某些Unicode字符”中。当我在html,doc和xls中打印它时,它可以用unicode很好地呈现所有内容。但是在PDF中,它忽略了字符或不正确打印Unicode部分。除此之外,一切都还好。

devs, I am facing a simple issue, but I couldn't figure out the actual reason.
I have a lot of reports in my ASP.NET Core 5 with angular 12 project. everything is rendered correctly except UNICODE Character.

see the below code example.

public static void Load(LocalReport report, decimal widgetPrice, decimal gizmoPrice) 
{ 
var items = new[] 
{ 
new ReportItem { Description = "Widget 6000 আমাদের A দেশের নাম বাংলাদেশ", Price = widgetPrice, Qty = 1 },
new ReportItem { Description = "Gizmo MAX", Price = gizmoPrice, Qty = 25 } 
};
var parameters = new[] { new ReportParameter("Title", "Invoice 4/2020") };
using var rs = Assembly.GetExecutingAssembly()
.GetManifestResourceStream("ReportViewerCore.Sample.AspNetCore.Reports.Report.rdlc");
report.LoadReportDefinition(rs); report.DataSources.Add(new ReportDataSource("Items", items));
report.SetParameters(parameters);
}

In the first ReportItem.Description= "Widget 6000 + some Unicode character in my language". when I print this in HTML, doc, and Xls, it renders everything well with Unicode. but in pdf, it ignores the characters or doesn't print properly the Unicode section. except for this, everything is okay.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文