Report Output Export File Name Issue in CRM 4.0


We have recently upgraded our CRM system from 3.0 to 4.0. Since then we are

having troubles with our reports.

Whenever we export the report to excel format, the file which is created in

CRM 4.0 has name as some "GUID".xls. Not just the name of the file, the sheet

contianing the output also has GUID as the name. This applies to other

formats also (output file name contains GUID).

I can save the rename the file as something else. But we have subscriptions

over most of our reports which sends out excel output of the report to a set

of ppl.

Instead of uploading the RDL from CRM 4.0, if i can upload the report to

some other SSRS folder and give a link, it will work. But we dont want to do


Can anyone help me with this?


Best Solution

Not sure, but it's possible to try create custom render extention for Excel. Change the Render method from article as it was proposed by this comment with the only difference - use excel format:

public bool Render(Report report, 
  NameValueCollection reportServerParameters, 
  NameValueCollection deviceInfo, NameValueCollection clientCapabilities, 
  EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, 
  CreateAndRegisterStream createAndRegisterStream)
    string strUri = string.Empty;
    strUri += 
    strUri += "?ReportSession=" + reportServerParameters["SessionID"];
    // Here you can check the name of report provided to viewer for export. 
    // If it's incorrect, you may extend method to set the right name.
    strUri += "&FileName=" + report.Name;  
    strUri += "&ControlId=" + Guid.Empty;
    strUri += "&Culture=" + 
    strUri += "&UICulture=" + 
    strUri += "&ReportStack=1";
    strUri += "&OpType=Export";
    strUri += "&ContentDisposition=OnlyHtmlInline";
    strUri += "&Format=MHTML";
    Stream outputStream = null;
    StreamWriter streamWriter = null;
        //Output to Excel
        outputStream = createAndRegisterStream(report.Name, "xls",
        "application/", true, StreamOper.CreateAndRegister);
        streamWriter = new StreamWriter(outputStream);
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strUri);
        request.Credentials = System.Net.CredentialCache.DefaultCredentials;
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        Stream inputStream = response.GetResponseStream();
        StreamReader streamReader = 
          new StreamReader(response.GetResponseStream());
        if (streamWriter != null)
    return false;

You may add this renderer as a new custom extention (you will have to change subscription format then) or replace existing excel extention - see Specifying Rendering Extension Parameters in Configuration Files

Related Question