SpreadsheetGear 2012 > Tutorials > Core Spreadsheet Engine |
Follow these steps to create a simple Console Application which demonstrates the SpreadsheetGear 2012 Core Engine.
Simple Core Engine Sample |
Copy Code
|
---|---|
static void Main(string[] args) { // Create a new empty workbook in a new workbook set. SpreadsheetGear.IWorkbook workbook = SpreadsheetGear.Factory.GetWorkbook(); // Get a reference to the first worksheet. SpreadsheetGear.IWorksheet worksheet = workbook.Worksheets["Sheet1"]; // Get a reference to the top left cell of Sheet1. SpreadsheetGear.IRange a1 = worksheet.Cells["A1"]; // Set a formula. a1.Formula = "=24901.55 / PI()"; // Output the result of the formula. Console.WriteLine("The diameter of the earth is " + a1.Value + " miles."); } |
The diameter of the earth is 7926.40954629997 miles.