0
votes

i have been trying to download an excel workbook from windows application(C#) with data from DB. i have few sheets that have static data and few sheets formulated with data from DB. There are few column where i have formatted excel formulas.

When i download the sheet that contains only DB data, the formulas columns have accurate value rendered in them. But while downloading with Static Data Sheets, the formulas is bind with columns but value is not rendered. On clicking on any cell for edit in the sheet,the values are rendered.

i am using NPOI dll. For adding the static data sheets, i have been initializing the excel to be downloaded with static field sheets and adding the remaining sheets.

  IWorkbook hssfwb;
ISheet sheetObj;
//--- read existing data
                    using (FileStream file = new FileStream(Existingfile, FileMode.Open, FileAccess.Read))
                    {
                        hssfwb = new XSSFWorkbook(file);
                        file.Close();
                    }
//-- adding sheets from DB data
 sheetObj = (XSSFSheet)hssfwb.CreateSheet(dtSet.Tables[sheetcount].TableName);
1

1 Answers

0
votes

I've faced the click and display problem before.

There is a ForceFormulaRecalculation property on ISheet, you can try to set it to true.