I have to create a program that creates some data for an stand out spreadsheet. Something fundamental like Name, surname, telephone number, e-mail per row with every category in the own column.

I do not know how to start. If a person could let me know which devices to reference and perhaps point me to some website or perhaps a book that covers writing/reading through data from an stand out spreadsheet using a c# program that might be great.

Thank you.

This specific feature is known as "Stand out Automation" insInternet where one can use C# to control your spreadsheet.

A great beginning point is going to be, http://support.microsoft.com/kb/302084#top

Regards, Andy.

With respect to the degree of sophistication needed:

  • Write a comma-separated values (CSV) text file. Stand out will open it up, nevertheless, you wont have any formatting.
  • Write an HTML table to file for and title the file as filename.xls.
  • Create an XML file inside a format that Excel can open.
  • Call Stand out directly and obtain it to construct the spreadsheet. (See cherhan's answer)

Give a mention of the Microsoft.Office.Interop.Stand out.

Presuming you've got a repository of this data somewhere, as well as your model looks something similar to

class Contact
{
    public string Firstname { get; set; }
    public string Lastname { get; set; }
    public string Email { get; set; }
    public string PhoneNumber { get; set; }
}

you are able to import it into stand out such as this

Application excelapp = new Application();
excelapp.Visible = true;

_Workbook workbook = (_Workbook)(excelapp.Workbooks.Add(Type.Missing));
_Worksheet worksheet = (_Worksheet)workbook.ActiveSheet;

worksheet.Cells[1, 1] = "First Name";
worksheet.Cells[1, 2] = "Last Name";
worksheet.Cells[1, 3] = "Email";
worksheet.Cells[1, 4] = "Phone Number";

int row = 1;

foreach (var contact in contacts)
{
    row++;

    worksheet.Cells[row, 1] = contact.Firstname;
    worksheet.Cells[row, 2] = contact.Lastname;
    worksheet.Cells[row, 3] = contact.Email;
    worksheet.Cells[row, 4] = contact.PhoneNumber;
}

excelapp.UserControl = true;

Read much more about the Stand out interop library here: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel%28v=office.11%29.aspx

Why not just produce a csv file, saving it as being xls. Is native stand out essential?

As cherhan pointed out, Stand out automation may be the standard, Microsoft method of programmatically creating excel spreadsheets. The disadvantages of the approach is it used a COM interop layer and for that reason requires Stand out (and licence) for every server your code is running on.

I have not handled to locate any great free projects for carrying this out much better, however, can suggest GemBox's spreadsheet API's like a well-made commercial option (plus there is a fundamental free version, great for testing it). One major plus for this approach is the fact that it's 100% handled code so makes deployment a little neater.

The option is most likely lower to if there is a budget you are prepared to invest in a library!