在asp net中以编程方式将水晶报告导出为没有临时文件的pdf

6

本文介绍了在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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

Func<string,string> 有什么区别?和委托?
What is the difference between Funclt;string,stringgt; and delegate?(Funclt;string,stringgt; 有什么区别?和委托?)...
2023-11-11 C#/.NET开发问题
3

ASP.NET MVC 中的 <%: 和 <%= 有什么区别?
What is the difference between lt;%: and lt;%= in ASP.NET MVC?(ASP.NET MVC 中的 lt;%: 和 lt;%= 有什么区别?)...
2023-11-10 C#/.NET开发问题
0

标签系统的 linq 查询 - 搜索多个标签
linq query for tag system - search for multiple tags(标签系统的 linq 查询 - 搜索多个标签)...
2023-11-10 C#/.NET开发问题
0

论坛标签.实施它们的最佳方法是什么?
Forum tags. What is the best way to implement them?(论坛标签.实施它们的最佳方法是什么?)...
2023-11-10 C#/.NET开发问题
1

html 脚本标签未使用类型 javascript <script type="text
html script tag not using type javascript lt;script type=quot;text/htmlquot;gt;?(html 脚本标签未使用类型 javascript lt;script type=quot;text/htmlgt;gt;?)...
2023-11-10 C#/.NET开发问题
6

ASP.NET 控件到 HTML 标记等效
ASP.NET Control to HTML tag equivalent(ASP.NET 控件到 HTML 标记等效)...
2023-11-10 C#/.NET开发问题
32