Free Support Forum - aspose.com

Firewall issues

After moving my application I can no longer use aspose.cell from any coputer except the web server I'm hosting on. I have search you forms and found this

You can test it by this method.

FileStream fs1 = new FileStream("d:\\book1.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();

With above code, you can try to read an Excel file and send to client browser without Aspose.Excel. That will help you to figure out what's the problem in web server settings.

I was able to open the test xls file remotely but not the one your software create, what could that mean?

myExcel.Save(strFileName, Aspose.Cells.SaveType.OpenInExcel, Aspose.Cells.FileFormatType.Excel2000, HttpContext.Current.Response), this works but only on the web server.

Hi,

Could you try to change the line to:

myExcel.Save(strFileName, Aspose.Cells.SaveType.OpenInBrowser, Aspose.Cells.FileFormatType.Excel2000, HttpContext.Current.Response) if it works fine for you.

Thank you.

This didn't help but I did discover that it works in FF, just not IE. Unfortunately FF is not a option so I'm still looking for solutions.

I am not very clear about your need. Do you run Aspose.Cells on your web server and want to send created files to client machines and open the file in client browser? May some http header doesn't work with your browser settings. You can try:

//Saves file to memory

MemoryStream stream = new MemoryStream();

excel.Save(stream, FileFormatType.Default);

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

//This is same as OpenInBrowser option

response.AddHeader( "content-disposition","inline; filename=book1.xls");

response.BinaryWrite(stream.ToArray());

Thanks for all your help, this was a IE bug, this is the final working code (at least it work for me this time :)

Dim myExcel As New Aspose.Cells.Excel

Dim wsMain As Aspose.Cells.Worksheet

Dim wsLookup As Aspose.Cells.Worksheet

myExcel.Worksheets.Add(Aspose.Cells.SheetType.Worksheet)

myExcel.Worksheets.Add(Aspose.Cells.SheetType.Worksheet)

wsMain = myExcel.Worksheets(0)

wsMain.Cells.ImportDataTable(dtAssets, True, 0, 0)

wsMain.Name = "DataToExcel"

Dim Stream As New MemoryStream

myExcel.Save(Stream, Aspose.Cells.FileFormatType.Excel2000)

HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"

HttpContext.Current.Response.AddHeader("content-disposition", "inline; filename=" & strFileName)

HttpContext.Current.Response.BinaryWrite(Stream.ToArray())