I have tried using the example in the link to get it to work under Medium trust but it doesn’t work. When it tries to open the page with the Aspose.Cells reference, it errors out right away and doesn’t even give me the changes to step through. I’m also trying to add the Aspose.Cells.dll to the web.config to grant it full trust like I’m trying with Aspose.PDF.
This is in my page load for the Aspose.Cells
License license = new License();
try
{
//Grab Aspose License key path and set the license
String strALP = WebConfigurationManager.AppSettings[“AsposeLicensePath”];
System.IO.Stream stream = System.IO.File.OpenRead(MapPath(“~”) + @“\Aspose.Total.lic”);
license.SetLicense(stream);
stream.Close();
}
catch (Exception ex)
{
Elmah.ErrorSignal.FromCurrentContext().Raise(new Exception(“Aspose License Issue”, ex));
Debug.WriteLine(“Trouble with License”);
}
CellsHelper.FontDir = MapPath(“~”) + @“\Fonts”;
// Need the selected risk IDs in a CommaDelimitedStringCollection
// so we can get back our risk items from RiskManager.
CommaDelimitedStringCollection cdscIds = new CommaDelimitedStringCollection();
string items;
if (Request.QueryString[“exportXLS”] != null)
{
items = Request.QueryString[“exportXLS”].ToString();
if (items.EndsWith(“,”))
items = items.Substring(0, items.IndexOf(“,”) - 1);
cdscIds.AddRange(items.Split(‘,’));
}
// codes to create the workbook.
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.ContentType = “application/excel”;
WB.Save(this.Response, “RMISExcelDetail.xlsx”, ContentDisposition.Attachment, new OoxmlSaveOptions());
Response.End();