Hello There:
We are planing to buy the Aspose.cells licence for a new and important project, sale's related on wich Aspose could be essential. But as we started building our try out project to see if aspose can be the solution we are encountering some problem when we publish the project to our hosting.
This is the code where we are encountering the error message:
workbook workbook = new Workbook();
foreach (DataTable dt in dsDatos.Tables)
{
Worksheet ws = workbook.Worksheets.Add(dt.TableName);
ws.PageSetup.FitToPagesWide = 1;
ws.Cells.ImportDataTable(dt, true, "A1");
}
workbook.Save(This.Response, fichero, ContentDisposition.Inline, new PdfSaveOptions(SaveFormat.Pdf));
Error Message we are getting:
System.NullReferenceException: Object reference not set to an instance of an object. at ..(String , Single , FontStyle ) at ..(String , Font , Double ) at ..(Graphics , Cells , Int32 , Int32 , Int32 , Int32 , AutoFitterOptions ) at ..AutoFitRow(Cells , Int32 , Int32 , Int32 , Int32 , AutoFitterOptions ) at Aspose.Cells.Worksheet.AutoFitRow(Int32 rowIndex) at ..(Worksheet ) at Aspose.Cells.WorksheetCollection.() at ...ctor(Workbook ) at Aspose.Cells.Workbook.Save(Stream stream, SaveOptions saveOptions) at Aspose.Cells.Workbook.Save(HttpResponse response, String fileName, ContentDisposition contentDisposition, SaveOptions saveOptions) at ParteHora.export.cmdExportar_Click(Object sender, EventArgs e)System.NullReferenceException: Object reference not set to an instance of an object. at ..(String , Single , FontStyle ) at ..(String , Font , Double ) at ..(Graphics , Cells , Int32 , Int32 , Int32 , Int32 , AutoFitterOptions ) at ..AutoFitRow(Cells , Int32 , Int32 , Int32 , Int32 , AutoFitterOptions ) at Aspose.Cells.Worksheet.AutoFitRow(Int32 rowIndex) at ..(Worksheet ) at Aspose.Cells.WorksheetCollection.() at ...ctor(Workbook ) at Aspose.Cells.Workbook.Save(Stream stream, SaveOptions saveOptions) at Aspose.Cells.Workbook.Save(HttpResponse response, String fileName, ContentDisposition contentDisposition, SaveOptions saveOptions) at ParteHora.export.cmdExportar_Click(Object sender, EventArgs e)
Any of the save constructors will function on the server, while debuggin in the local machine it works just fine.
P.S. We are totally able to read, modify the aspose workbook from stream or physical file, pretty well, the only problem have emerged when trying to save. We've already checked permission for writing on the server, and save file through a Fileupload asp.net component and it worked good. It's not about writing in the server directories.
Please help us with this asap, as we need to decide if aspose is the right solution to our project.
The web server for the hosting is runing .net 3.5 framework, and it's windows based.
Best regards,
Youssef