Static void main (string [] args) {com.excel.cexcelfile Excel = new com.excel.cexcelfile (); Excel.createFile ("c: //test.xls"); Excel.printGridLines = false;
COM.Excel.cExcelFile.MarginTypes mt1 = COM.Excel.cExcelFile.MarginTypes.xlsTopMargin; COM.Excel.cExcelFile.MarginTypes mt2 = COM.Excel.cExcelFile.MarginTypes.xlsLeftMargin; COM.Excel.cExcelFile.MarginTypes mt3 = COM.Excel .cExcelFile.MarginTypes.xlsRightMargin; COM.Excel.cExcelFile.MarginTypes mt4 = COM.Excel.cExcelFile.MarginTypes.xlsBottomMargin; double height = 1.5; excel.SetMargin (ref mt1, ref height); excel.SetMargin (ref mt2, ref Height); Excel.SetMargin (Ref Mt3, Ref Height); Excel.set Margin (Ref MT4, Ref Height);
Com.excel.cexcelfile.fontformatting ff = com.excel.cexcelfile.fontformatting.xlsitalic; string font = "arial"; short fontsize = 12; Excel.setfont (Ref font, ref fontsize, ref ff);
BYTE B1 = 1, B2 = 12; Short S3 = 18; Excel.SetColumnWidth (Ref B1, Ref B2, Ref S3);
String header = "head"; string footer = "angle"; Excel.sethead; Excel.Setfooter;
COM.Excel.cExcelFile.ValueTypes vt = COM.Excel.cExcelFile.ValueTypes.xlsText; COM.Excel.cExcelFile.CellFont cf = COM.Excel.cExcelFile.CellFont.xlsFont0; COM.Excel.cExcelFile.CellAlignment ca = COM.Excel .cExcelFile.CellAlignment.xlsLeftAlign; COM.Excel.cExcelFile.CellHiddenLocked chl = COM.Excel.cExcelFile.CellHiddenLocked.xlsNormal; int row = 1, col = 1, cellformat = 0; object title = "EXCEL did not use any components directly Written into an Excel file, Cool?! "; Excel.writevalue (Ref vt, ref cf, ref coa, ref chl, ref curd); int RET = Excel.Closefile (); IF (RET! = 0) {Console.writeline ("Error!");} else {console.writeline ("Please open file c: //test.xls!");}}