App.direct - Response error

  1. #1

    App.direct - Response error

    Hi, I have App.direct function that goes to server to generate an Excel document to the client:

    App.direct.GridPanel_PD_ExportToExcel(visibleColumnDefinitionsJSON, Store_PD_Data_JSON);
    Than, on the server side I generate Execel file and I write it to the response:

                    this.Response.Clear();
                    this.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                    this.Response.AddHeader("Content-Disposition",
                                            string.Format("attachment; filename=\"{0}.xlsx\"",
                                            SR.ProfileDataCompl_Panel_Title(searchPanel.selected_DateFrom.ToString("yyyy-MM-dd"), searchPanel.selected_DateTo.ToString("yyyy-MM-dd"))      
                                            ));
    
                        Response.BinaryWrite(excel);
                        Response.Flush();
                        Response.Close();
    When it returns to the client browser, instead of start downloading this file I get an error in browser console:

    Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING


    Some time ago I used to use above asp.net methods and it all worked fine when I was calling to the server using Store OnSubmitData event.
    I had to use some other way around because I couldn't find a way to pass my custom parameters to the server.
    So I've started to use App.direct,m but it throws above error.

    How can I solve this problem?
    Last edited by WojciechK; Jun 03, 2014 at 1:14 PM.
  2. #2
    Hi @WojciechK,

    Please try:
    App.direct.GridPanel_PD_ExportToExcel(visibleColumnDefinitionsJSON, Store_PD_Data_JSON, {
        isUpload: true, // Yes, it is confusing. We have an issue for that - https://github.com/extnet/Ext.NET/issues/210
        formId: "actualFormId"
    });
  3. #3
    Thanks, your solution did the job.

Similar Threads

  1. [CLOSED] MultiUpload MVC response error in IE 11
    By jpadgett in forum 2.x Legacy Premium Help
    Replies: 28
    Last Post: Sep 26, 2014, 8:44 PM
  2. Replies: 0
    Last Post: Aug 05, 2012, 10:46 AM
  3. [CLOSED] Can I use Response object in a direct method call?
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 12, 2012, 11:50 AM
  4. Replies: 4
    Last Post: May 14, 2012, 10:22 AM
  5. Error on AjaxEvent Response
    By jcanton in forum 1.x Help
    Replies: 2
    Last Post: Jan 25, 2009, 4:38 PM

Posting Permissions