Hi,
I am using aspse.cell for .net version: v7.7.1.0.
my xlsx template have one pivot table which refer to one table in other tab.
see GBLU.xlsx file first.
my requirement is to filled in table content and refresh pivot table second.
my issue is that when I insert at least one record in the table and saved it out.
when Excel open this file, it will popup some error message.
I search some stuff in this forum, it seems this issue found out before.
but in my aspose.cell version, it seems it still encounter this issue.
Please advise how to avoid this error message popup, thx.
I am afraid Pivot Table always encountered this issue.
first excel is my template, second one is my output excel.
error message will popu when I open second one.
My office is Excel 2010, 64 bit. my code is simple as below:
[HttpGet]
public void ExportGBLUReport(string Region, int CountryId, string Year)
{
var excelFilePath = System.Web.HttpContext.Current.Server.MapPath(GBLUFileName);
FileStream stream = new FileStream(excelFilePath, FileMode.Open,FileAccess.ReadWrite,FileShare.ReadWrite);
Workbook workbook = new Workbook(stream);
//populate lu tab
var luGrid = this.RetrieveGBLUGrid(Region, CountryId, Year);
Worksheet luSheetView = workbook.Worksheets[“Legislative Updates”];
int startRowIndex = 1;
foreach (var item in luGrid)
{
luSheetView.Cells[startRowIndex, 0].Value = GetCountryName(item.CountryId);
luSheetView.Cells[startRowIndex, 1].Value = string.Format("{0}-{1}", item.Year, item.Month);
luSheetView.Cells[startRowIndex, 2].Value = item.EmployerActionRequiredByLaw;
luSheetView.Cells[startRowIndex, 3].Value = item.Summary;
luSheetView.Cells[startRowIndex, 4].Value = item.HRArea;
luSheetView.Cells[startRowIndex, 5].Value = item.LawInForce;
luSheetView.Cells[startRowIndex, 6].Value = item.NewLaw;
luSheetView.Cells[startRowIndex, 7].Value = item.ImpactByEmployers;
startRowIndex++;
break;//only populate one row
}
////Save file and send to client browser using selected format
workbook.SaveOptions.ClearData = true;
string CurrectDate = System.DateTime.Now.Date.ToString(“dd-MMM-yyyy”);
workbook.Save(System.Web.HttpContext.Current.Response, ReportType.GlobalBenefitsLegislativeUpdates + " (" + CurrectDate + “).” + “XLSX”,
ContentDisposition.Attachment, new XlsSaveOptions(Aspose.Cells.SaveFormat.Xlsx));
//end response to avoid unneeded html
System.Web.HttpContext.Current.Response.End();
}