NpsExcel class

NpsExcel help to read/create/overwrite excel spreadsheets.

Sample code for reading excel spreadsheet:
var excel = new NpsExcel(new NpsFile("myexcel.xls"),'r');
out.Info(excel.sheets);
excel.currentsheet=0;
out.Info(excel.sheetname);
out.Info(excel.rows);
out.Info(excel.columns);
out.Info(excel.GetCell(0,0));
out.Info(excel.GetString(1,1));
out.Info(excel.GetDouble(2,2));
out.Info(excel.GetDate(3,3));
out.Info(excel.GetBoolean(4,4));
excel.Close();


Sample code for creating excel spreadsheet:
var format1 = new NpsExcelFormat("","");
format1.SetFont("Arial",11,true,false,false,"black");
format1.SetAlignment("centre");
format1.SetVerticalAlignment("centre");
format1.SetBorder("all","thin");
format1.SetBackground("yellow");
format1.SetOrientation("horizon");
var excel = new NpsExcel(new NpsFile("new.xls"),'n');
excel.CreateSheet("My sheet",0);
excel.MergeCell(0,0,0,10);
excel.AddString(0,0,"TITLE TEST",format1);
excel.AddNumber(1,0,2.5,format1);
excel.AddDate(2,0,new Date(),format1);
excel.AddBoolean(3,0,true,format1);
excel.AddFormula(4,0,"5*2",format1);
excel.Write();
excel.Close();

Sample code for modifying excel spreadsheet:
var excel = new NpsExcel(new NpsFile("old.xls"),'rw');
excel.SetString(0,0,"MODIFY");
excel.SetNumber(1,0,3.8);
excel.SetString(1,0,"STRING");
excel.SetDate(2,0,new Date(2005,7,20));
excel.SetBoolean(3,0,false);
excel.SetFormula(4,0,"10*2");
excel.SetString(0,5,"STRING2");
excel.Write();
excel.Close();

top

Property Summary

top

Method Summary