You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
894 B
33 lines
894 B
using System;
|
|
using libxl;
|
|
|
|
namespace generate
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
try
|
|
{
|
|
Book book = new BinBook();
|
|
Sheet sheet = book.addSheet("Sheet1");
|
|
|
|
sheet.writeStr(2, 1, "Hello, World !");
|
|
sheet.writeNum(3, 1, 1000);
|
|
|
|
Format dateFormat = book.addFormat();
|
|
dateFormat.setNumFormat(NumFormat.NUMFORMAT_DATE);
|
|
sheet.writeNum(4, 1, book.datePack(2008, 4, 29), dateFormat);
|
|
sheet.setCol(1, 1, 12);
|
|
|
|
book.save("example.xls");
|
|
|
|
System.Diagnostics.Process.Start("example.xls");
|
|
}
|
|
catch (System.Exception e)
|
|
{
|
|
Console.WriteLine(e.Message);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|