从crystal viewer c#设置导出文件的动态名称 [英] Set dynamic name for exported file from crystal viewer c#

查看:83
本文介绍了从crystal viewer c#设置导出文件的动态名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我需要为水晶查看器c#设置下载文件的名称,我在搜索后尝试了这段代码,但它不能正常工作



Now I need to set name for downloaded file from crystal viewer c#, I've tried this code after search but it is not working

protected void Page_Init(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        ReportDocument doc = (ReportDocument)Session["ReportView"];
        doc.SummaryInfo.ReportTitle = ((ReportDocument)Session["ReportView"]).SummaryInfo.ReportTitle;//"MyVeryOwnExportFile";
        CrystalReportViewer1.ReportSource = doc;
        CrystalReportViewer1.BestFitPage = false;
    }
    else
    {
        ReportDocument doc = (ReportDocument)Session["ReportView"];
        doc.SummaryInfo.ReportTitle = "MyVeryOwnExportFile";
        CrystalReportViewer1.ReportSource = doc;
    }
}





当我尝试使用此代码为导出文件设置动态名称时,这是工作但影响观众和下一页在此更改后变得不起作用





And when I tried this code to set dynamic name for exported file by this way it's working but affects on viewer and next page become not work after this change

CrystalReportViewer1.ID="downloaded file name";


这行之后的
我可以用动态下载文件名称,但视图中的下一页选项无法正常工作。


after this line I can download file with dynamic names but next page option in view become not working.

推荐答案

设置ID CrystalReportViewer1.ID =下载文件名;在页面初始化事件。
Set id CrystalReportViewer1.ID="downloaded file name"; on page init event.


这篇关于从crystal viewer c#设置导出文件的动态名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆