Skip to main content
Changed link to https, improved formatting
Source Link
Kolappan N
  • 3.9k
  • 2
  • 37
  • 43

The commercial solution, SpreadsheetGear for .NETSpreadsheetGear for .NET will do it.

You can see live ASP.NET (C# and VB) samples herehere and download an evaluation version here.

Disclaimer: I own SpreadsheetGear LLC

The commercial solution, SpreadsheetGear for .NET will do it.

You can see live ASP.NET (C# and VB) samples here and download an evaluation version here.

Disclaimer: I own SpreadsheetGear LLC

The commercial solution, SpreadsheetGear for .NET will do it.

You can see live ASP.NET (C# and VB) samples here and download an evaluation version here.

Disclaimer: I own SpreadsheetGear LLC

Specified it is commercial solution to dispense any negetive judgement and make known its intent.
Source Link
TamusJRoyce
  • 825
  • 1
  • 14
  • 27

The commercial solution, SpreadsheetGear for .NET will do it.

You can see live ASP.NET (C# and VB) samples here and download an evaluation version here.

Disclaimer: I own SpreadsheetGear LLC

SpreadsheetGear for .NET will do it.

You can see live ASP.NET (C# and VB) samples here and download an evaluation version here.

Disclaimer: I own SpreadsheetGear LLC

The commercial solution, SpreadsheetGear for .NET will do it.

You can see live ASP.NET (C# and VB) samples here and download an evaluation version here.

Disclaimer: I own SpreadsheetGear LLC

Post Made Community Wiki
Replaced long answer which others found objectionable (see comments) and replaced with (hopefully) short, concise answer.
Source Link
Joe Erickson
  • 7.2k
  • 1
  • 32
  • 31

SpreadsheetGear for .NET is used by thousands of developers to create, read, modify, view, edit, format, calculate, print and write Excel workbooks without Excelwill do it.

You can see live ASP.NET see what our customers say(C# and try it for yourself with theVB) samples here and download an evaluation version free, fully-functional evaluationhere.

Here is some C# code to create a simple workbook (you could also start with an existing workbook)Disclaimer: I own SpreadsheetGear LLC

static void CreateSimpleWorkbook()
{
    // Create a new workbook.
    SpreadsheetGear.IWorkbook workbook = SpreadsheetGear.Factory.GetWorkbook();
    SpreadsheetGear.IWorksheet worksheet = workbook.Worksheets["Sheet1"];
    SpreadsheetGear.IRange cells = worksheet.Cells;

    // Set the worksheet name.
    worksheet.Name = "2005 Sales";

    // Load column titles and center.
    cells["B1"].Formula = "North";
    cells["C1"].Formula = "South";
    cells["D1"].Formula = "East";
    cells["E1"].Formula = "West";
    cells["B1:E1"].HorizontalAlignment = SpreadsheetGear.HAlign.Center;

    // Load row titles using multiple cell text reference and iteration.
    int quarter = 1;
    foreach (SpreadsheetGear.IRange cell in cells["A2:A5"])
        cell.Formula = "Q" + quarter++;

    // Load random data and format as $ using a multiple cell range.
    SpreadsheetGear.IRange body = cells[1, 1, 4, 4];
    body.Formula = "=RAND() * 10000";
    body.NumberFormat = "$#,##0_);($#,##0)";

    // Save as xls to Disk (can also open / save from / to streams and memory)
    workbook.SaveAs(@"C:\tmp\SimpleWorkbook.xls", SpreadsheetGear.FileFormat.Excel8);

    // Save as xlsx to Disk.
    workbook.SaveAs(@"C:\tmp\SimpleWorkbook.xlsx", SpreadsheetGear.FileFormat.OpenXMLWorkbook);
}

SpreadsheetGear for .NET is used by thousands of developers to create, read, modify, view, edit, format, calculate, print and write Excel workbooks without Excel.

You can see what our customers say and try it for yourself with the free, fully-functional evaluation.

Here is some C# code to create a simple workbook (you could also start with an existing workbook):

static void CreateSimpleWorkbook()
{
    // Create a new workbook.
    SpreadsheetGear.IWorkbook workbook = SpreadsheetGear.Factory.GetWorkbook();
    SpreadsheetGear.IWorksheet worksheet = workbook.Worksheets["Sheet1"];
    SpreadsheetGear.IRange cells = worksheet.Cells;

    // Set the worksheet name.
    worksheet.Name = "2005 Sales";

    // Load column titles and center.
    cells["B1"].Formula = "North";
    cells["C1"].Formula = "South";
    cells["D1"].Formula = "East";
    cells["E1"].Formula = "West";
    cells["B1:E1"].HorizontalAlignment = SpreadsheetGear.HAlign.Center;

    // Load row titles using multiple cell text reference and iteration.
    int quarter = 1;
    foreach (SpreadsheetGear.IRange cell in cells["A2:A5"])
        cell.Formula = "Q" + quarter++;

    // Load random data and format as $ using a multiple cell range.
    SpreadsheetGear.IRange body = cells[1, 1, 4, 4];
    body.Formula = "=RAND() * 10000";
    body.NumberFormat = "$#,##0_);($#,##0)";

    // Save as xls to Disk (can also open / save from / to streams and memory)
    workbook.SaveAs(@"C:\tmp\SimpleWorkbook.xls", SpreadsheetGear.FileFormat.Excel8);

    // Save as xlsx to Disk.
    workbook.SaveAs(@"C:\tmp\SimpleWorkbook.xlsx", SpreadsheetGear.FileFormat.OpenXMLWorkbook);
}

SpreadsheetGear for .NET will do it.

You can see live ASP.NET (C# and VB) samples here and download an evaluation version here.

Disclaimer: I own SpreadsheetGear LLC

Source Link
Joe Erickson
  • 7.2k
  • 1
  • 32
  • 31
Loading