Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141485 | Dec 13,2018 06:07 PM UTC | Dec 18,2018 01:04 PM UTC | Xamarin.Forms | 3 |
![]() |
Tags: XlsIO |
Query |
Answer | |
Formula calculation issue |
We are able to reproduce the scenario from the below cases.
Code snippet:
| |
Average calculation for several columns |
You can loop through the columns and set the average for all the columns using IWorksheet.Range[int firstRow,int firstCol,int lastRow,int lastColumn] property instead of using the name of the cell every time.
Please refer the code snippet below.
Code snippet:
|
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
DataTable reports = new DataTable();
reports.Columns.Add("SalesPerson");
reports.Columns.Add("SaleJanJune");
reports.Columns.Add("SaleJulyDec");
reports.Rows.Add("Andy Bernard", "12400","25500");
reports.Rows.Add("Jim Halpert", "45000", "35000");
reports.Rows.Add("Karen Fillippelli", "34000", "98000");
reports.Rows.Add("Phyllis Lapin", "70000", "90000");
reports.Rows.Add("Stanley Hudson", "80000", "90000");
worksheet.ImportDataTable(reports, true, 1, 1, false); |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.