我正在使用UWP应用程序从带有Syncfusion组件的.rdlc模板文件生成.pdf文件。我可以从rdlc模板文件生成pdf,但pdf(文本或图像)中的所有链接都不起作用。如果我生成一个html文件而不是pdf文件,链接可以工作。这是代码:
var pdfFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(String.Concat("Order-", this.Model.SaleReference, ".pdf"), CreationCollisionOption.ReplaceExisting);
using (var stream = await pdfFile.OpenAsync(FileAccessMode.ReadWrite))
{
using (var outstream = stream.AsStreamForWrite())
{
var assembly = typeof(FinalizeViewModel).GetTypeInfo().Assembly;
var reportStream = assembly.GetManifestResourceStream("UWP.OrderModule.Reports.Test.rdlc");
var writer = new ReportWriter(reportStream)
{
ExportMode = Syncfusion.ReportWriter.ExportMode.Local
};
writer.Save(outstream, WriterFormat.PDF);
outstream.Dispose();
}
}
await Windows.System.Launcher.LaunchFileAsync(pdfFile);
我也尝试使用此代码,但结果是一样的:
var file = await ApplicationData.Current.LocalFolder.CreateFileAsync(String.Concat("Order-", this.Model.SaleReference, ".pdf"), CreationCollisionOption.ReplaceExisting);
using (var stream = await WindowsRuntimeStorageExtensions.OpenStreamForWriteAsync(file))
{
var assembly = typeof(FinalizeViewModel).GetTypeInfo().Assembly;
var reportStream = assembly.GetManifestResourceStream("UWP.OrderModule.Reports.Test.rdlc");
var writer = new ReportWriter(reportStream)
{
ReportProcessingMode = Syncfusion.ReportWriter.ProcessingMode.Local,
ExportMode = Syncfusion.ReportWriter.ExportMode.Local
};
writer.Save(stream, WriterFormat.PDF);
}
await Windows.System.Launcher.LaunchFileAsync(pdfFile);
有什么问题? ReportWriter类(Syncfusion.RdllO.RdllOExportEngine类)中是否存在问题? 谢谢你的帮助。
答案 0 :(得分:0)
目前Syncfusion ReportWriter不支持将报告导出为带有超链接选项的PDF。我们将考虑在即将发布的任何版本中包含此功能。