Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

export to excel in SSL. is throwing error

Last post 11-27-2008, 4:59 AM by Amjad Sahi. 4 replies.
Sort Posts: Previous Next
  •  11-24-2008, 11:18 AM 153933

    export to excel in SSL. is throwing error

    Hi,

    Im trying to export data to excel using aspose through our SSL enabled site. I'm getting the following error "internet explorer cannot download pagename.aspx from abc.com. Internet explorer was not able to open this internet site. The requested site is either unavailable or not found. Please try later".

    I'm using following code.

    MemoryStream stream = new MemoryStream();

    workbook.Save(stream, FileFormatType.Default);

    response.ContentType = "application/vnd.ms-excel";

    response.AddHeader( "content-disposition","attachment;  filename=” + Session["ReportType"] + ".xls");

    response.BinaryWrite(stream.ToArray());

    Any help on this is much appreciated. The same code works if ssl is off


    This message was posted using Page2Forum from Aspose.Cells for .NET and Java - Documentation
     
  •  11-24-2008, 12:09 PM 153942 in reply to 153933

    Re: export to excel in SSL. is throwing error

    Hi,

    Well, I think this is the issue with IE / browser type. Are you using IE 6.0 version. I think you may try the following steps (opening the Internet Explorer) if it fixes the issue.

    • Click Tools>Internet Options
    • Click the Advanced tab
    • Check the box that says Do not save encrypted pages to disk

    I think alternatively, since you pass the spreasheet to the Response object, you might try setting the cachability before writing the streams
    e.g..,

    Response.Cache.SetCachebility(HttpCache.NoCache);

     

    Thank you.



    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  11-24-2008, 1:44 PM 153962 in reply to 153942

    Re: export to excel in SSL. is throwing error

    Thanks for your prompt response. let me try and let you kno.
     
  •  11-27-2008, 3:04 AM 154373 in reply to 153942

    Re: export to excel in SSL. is throwing error

    Hi,

     

    thanks for your response.  But the issue still exists.

    i used the following piece of code

     

    Response.ClearHeaders();

    Response.ClearContent();

    Response.Buffer = true;

    //workbook.Save(Session["ReportType"] + ".xls", FileFormatType.Default, SaveType.OpenInExcel, Response);

    MemoryStream stream = new MemoryStream();

    workbook.Save(stream, FileFormatType.Default);

    //workbook.Save(Session["ReportType"] + ".xls", FileFormatType.Default, SaveType.OpenInExcel, Response);

    Response.Cache.SetCacheability(HttpCacheability.NoCache);

    Response.ContentType = "application/vnd.ms-excel";

    Response.AddHeader("content-disposition", "attachment; filename= " + Session["ReportType"] + ".xls");

    Response.BinaryWrite(stream.ToArray());

    Response.Flush();

     

     

     
  •  11-27-2008, 4:59 AM 154393 in reply to 154373

    Re: export to excel in SSL. is throwing error

    Hi,

    Could you try the following code without using Aspose.Cells APIs if the issue is still there.

    FileStream fs1 = new FileStream("d:\\testbook.xls", FileMode.Open, FileAccess.Read);
    byte[] data1 = new byte[fs1.Length];
    fs1.Read(data1, 0, data1.Length);

    this.Response.ContentType = "application/xls";
    Response.AddHeader( "content-disposition","inline;  filename=book1.xls");
    Response.BinaryWrite(data1);
    Response.End();


    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
View as RSS news feed in XML