export crystal report to pdf without temp file programmatically in asp net(在asp net中以编程方式将水晶报告导出为没有临时文件的pdf)
问题描述
如何在没有临时文件的情况下在 asp 网络中以编程方式将水晶报告导出为 pdf 从服务器到最终用户.如果我们删除临时文件夹的写访问权限,则会导致错误.我们的管理员不授予访问权限.是否可以为最终用户将水晶报告导出为 pdf 的任何选项.请提出建议.
how to export crystal report to pdf without temp file programmatically in asp net from server to end user. If we remove write access of temp folder , then it will cause error.Our admin not giving access to it.Is that any option to export crystal report to pdf for end user. Please suggest.
reportDocument.Load(this.MapPath("xyz.rpt"));
reportDocument.Database.Tables[0].SetDataSource(dsReport.Tables[0]);
rptviewer.ReportSource = Salary_reportDocument;
rptviewer.Visible = true;
rptviewer.DataBind();
reportDocument.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "XYZReport");
推荐答案
像这样的
{
ExportOptions CrExportOptions ;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = "c:\csharp.net-informations.pdf";
CrExportOptions = cryRpt.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
cryRpt.Export();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
这篇关于在asp net中以编程方式将水晶报告导出为没有临时文件的pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在asp net中以编程方式将水晶报告导出为没有临时文件的pdf
基础教程推荐
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
