Click here to Skip to main content
15,904,023 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

C#
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

C#
CrystalReportViewer1.ID="downloaded file name";

after this line I can download file with dynamic names but next page option in view become not working.
Posted
Updated 2-Nov-17 19:20pm

1 solution

Set id CrystalReportViewer1.ID="downloaded file name"; on page init event.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900