Visual Studio 2005, C#, ASP.net 2.0, Aspose.Cells 22.214.171.124
My goal:Generate a PDF (with images) from an excel spreadsheet edited on the web.
The issue: I'm unable to translate what I see in the web grid to the PDF.
Here's the scenario. The user enters in data via Gridweb (including formulas) and wants to save the resulting spreadsheet to a PDF file. They have images that they want to insert as well. GridWeb does neither of these, but Aspose.Cells does. So I save as an Excel file and open with Aspose.Cells like this:
Workbook book = new Workbook();
DataSet DS = new DataSet();
clsTemplate oTemplate = new clsTemplate();
Sure enough, I can insert my images and save as a PDF:
book.Worksheets.Pictures.Add(0, 0, Server.MapPath("App_Data/EImages/") + "U" + Session["PersonID"].ToString().Trim() + ".jpg");
book.Save("Preview.pdf", Aspose.Cells.FileFormatType.Pdf, SaveType.OpenInExcel, System.Web.HttpContext.Current.Response);
But there's a problem. My calculations aren't showing up in the PDF. I do a little research and figure out that the formulas (not the results) are what saved to the excel file so I need to fire the calculation engine. Okay, easy enough:
Problem solved? Not quite. It turns out that the supported formulas are not the same between Gridweb and Aspose.cells. Most notably I'm missing the LOG function (though I have LOG10 for some reason). I get an error stating I have an "Unsuported Formula" and the remaining calculations do not execute.
so.. Short of manually (looping) copying the calcuated values from the Gridweb Excel spreadsheet to the Aspose.Cells spreadsheet. Is there a better solution to this?