1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
package Tutorial16;
import System.*;
import EasyXLS.*;
import EasyXLS.Constants.*;
public class Tutorial16
{
public Tutorial16()
{
}
public static void main(String[] args)
{
Console.WriteLine("Tutorial 16\n----------\n");
ExcelDocument workbook = new ExcelDocument(2);
workbook.easy_getSheetAt(0).setSheetName("First tab");
workbook.easy_getSheetAt(1).setSheetName("Second tab");
((ExcelWorksheet)workbook.easy_getSheetAt(0)).easy_addImage("C:\\Samples\\EasyXLSLogo.JPG", "A1");
Console.WriteLine("Writing file C:\\Samples\\Tutorial16 - images in Excel.xlsx.");
workbook.easy_WriteXLSXFile("C:\\Samples\\Tutorial16 - images in Excel.xlsx");
String sError = workbook.easy_getError();
if (sError.Equals(""))
Console.Write("\nFile successfully created. Press Enter to Exit...");
else
Console.Write("\nError encountered: " + sError + "\nPress Enter to Exit...");
workbook.Dispose();
Console.ReadLine();
}
}
|