@Martin Dráb this is the code ...
static void AMY_Exceltemplates()
{
#AviFiles
ComVariant CellValue;
counter sno,col,row,setcount;
int black = WinAPI::RGB2int(0,0,0);
KOTAExcelReporter KOTAExcelReporter = new KOTAExcelReporter();
str a,b;
SysExcelApplication sysExcelApplication;
COM comWindow, comApplication,comSheet;
SysOperationProgress sysOperationProgress = new SysOperationProgress(1);
setPrefix("Extracting Data");
sysOperationProgress.setAnimation(#aviTransfer);
sysOperationProgress.setCaption("Opening Template");
sysOperationProgress.setText("Processing...");
sysOperationProgress.update(true);
//for the freeze on the row
sysExcelApplication = SysExcelApplication::construct();
comApplication = sysExcelApplication.comObject();
comWindow = comApplication.activeWindow();
comWindow.splitcolumn(1);
comWindow.splitRow(row);
comWindow.freezePanes(true);
//ennded the code for freeze
KOTAExcelReporter.xlInsert(types::String, 1, 3, strfmt(" Quality Report "));
KOTAExcelReporter.xlFormatCell("C1",15,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 2, 1, "Branch:");
KOTAExcelReporter.xlFormatCell("A2",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 2, 5, "Date:");
KOTAExcelReporter.xlFormatCell("E2",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 2, 7, "From:");
KOTAExcelReporter.xlFormatCell("G2",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 2, 10, "To:");
KOTAExcelReporter.xlFormatCell("J2",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 4, 1, "No.");
KOTAExcelReporter.xlFormatCell("A4",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 4, 2, "Kitchen");
KOTAExcelReporter.xlFormatCell("B4",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 4, 3, "Bad");
KOTAExcelReporter.xlFormatCell("C4",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 4, 4, "Good");
KOTAExcelReporter.xlFormatCell("D4",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 4, 4, "Excellent");
KOTAExcelReporter.xlFormatCell("E4",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 4, 5, "Comment");
KOTAExcelReporter.xlFormatCell("F4",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 5, 1, "1");
KOTAExcelReporter.xlFormatCell("A5",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 5, 2, "Floors");
KOTAExcelReporter.xlInsert(types::String, 6, 1, "2");
KOTAExcelReporter.xlFormatCell("A6",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 6, 2, "Tables");
KOTAExcelReporter.xlInsert(types::String, 7, 1, "3");
KOTAExcelReporter.xlFormatCell("A7",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 7, 2, "Fridges");
KOTAExcelReporter.xlInsert(types::String, 8, 1, "4");
KOTAExcelReporter.xlFormatCell("A8",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 8, 2, "Store");
KOTAExcelReporter.xlInsert(types::String, 9, 1, "Comment for kitchen");
KOTAExcelReporter.xlFormatCell("A9",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 11, 1, "No.");
KOTAExcelReporter.xlFormatCell("A11",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 11, 2, "Temprature");
KOTAExcelReporter.xlFormatCell("B11",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 11, 3, "Bad");
KOTAExcelReporter.xlFormatCell("C11",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 11, 4, "Good");
KOTAExcelReporter.xlFormatCell("D11",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 11, 5, "Excellent");
KOTAExcelReporter.xlFormatCell("E11",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 11, 6, "Comment");
KOTAExcelReporter.xlFormatCell("F11",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 12, 1, "1");
KOTAExcelReporter.xlFormatCell("A12",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 12, 2, "Floors");
KOTAExcelReporter.xlInsert(types::String, 13, 1, "2");
KOTAExcelReporter.xlFormatCell("A13",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 13, 2, "Fridges");
KOTAExcelReporter.xlInsert(types::String, 14, 1, "3");
KOTAExcelReporter.xlFormatCell("A14",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 14, 2, "Marie Milk");
KOTAExcelReporter.xlInsert(types::String, 15, 1, "4");
KOTAExcelReporter.xlFormatCell("A15",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 15, 2, "Frying");
KOTAExcelReporter.xlInsert(types::String, 16, 1, "Comment for temprature");
KOTAExcelReporter.xlFormatCell("A16",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 18, 1, "No.");
KOTAExcelReporter.xlFormatCell("A18",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 18, 2, "Hall");
KOTAExcelReporter.xlFormatCell("B18",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 18, 3, "Bad");
KOTAExcelReporter.xlFormatCell("C18",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 18, 4, "Good");
KOTAExcelReporter.xlFormatCell("D18",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 18, 5, "Excellent");
KOTAExcelReporter.xlFormatCell("E18",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 18, 6, "Comment");
KOTAExcelReporter.xlFormatCell("F18",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 19, 1, "1");
KOTAExcelReporter.xlFormatCell("A19",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 19, 2, "Placemats");
KOTAExcelReporter.xlInsert(types::String, 20, 1, "2");
KOTAExcelReporter.xlFormatCell("A20",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 20, 2, "Glass");
KOTAExcelReporter.xlInsert(types::String, 21, 1, "3");
KOTAExcelReporter.xlFormatCell("A21",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 21, 2, "Silver");
KOTAExcelReporter.xlInsert(types::String, 22, 1, "4");
KOTAExcelReporter.xlFormatCell("A22",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 22, 2, "Tables");
KOTAExcelReporter.xlInsert(types::String, 23, 1, "5");
KOTAExcelReporter.xlFormatCell("A23",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 23, 2, "Floors");
KOTAExcelReporter.xlInsert(types::String, 24, 1, "Comment for Hall");
KOTAExcelReporter.xlFormatCell("A24",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 26, 1, "No.");
KOTAExcelReporter.xlFormatCell("A26",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 26, 2, "General Cleanliness & Hygenie");
KOTAExcelReporter.xlFormatCell("B26",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 26, 3, "Bad");
KOTAExcelReporter.xlFormatCell("C26",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 26, 4, "Good");
KOTAExcelReporter.xlFormatCell("D26",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 26, 5, "Excellent");
KOTAExcelReporter.xlFormatCell("E26",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 26, 6, "Comment");
KOTAExcelReporter.xlFormatCell("F26",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 27, 1, "1");
KOTAExcelReporter.xlFormatCell("A27",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 27, 2, "WC Singles");
KOTAExcelReporter.xlInsert(types::String, 28, 1, "2");
KOTAExcelReporter.xlFormatCell("A28",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 28, 2, "WC Families");
KOTAExcelReporter.xlInsert(types::String, 29, 1, "3");
KOTAExcelReporter.xlFormatCell("A29",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 29, 2, "Outside the Restaurant");
KOTAExcelReporter.xlInsert(types::String, 30, 1, "4");
KOTAExcelReporter.xlFormatCell("A30",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 30, 2, "Service Providers");
KOTAExcelReporter.xlInsert(types::String, 31, 1, "5");
KOTAExcelReporter.xlFormatCell("A31",10,true,false,false,1,false,false,"Segoe UI",black);
KOTAExcelReporter.xlInsert(types::String, 31, 2, "Kitchen Workers");
KOTAExcelReporter.xlInsert(types::String, 32, 1, "Comment for General Cleanliness & Hygenie");
KOTAExcelReporter.xlFormatCell("A32",10,true,false,false,1,false,false,"Segoe UI",black);
col = 6;
row = 2;
KOTAExcelReporter.xlInsert(types::String, row, 6, strfmt("%1",systemDateGet()));
a = time2str(timeNow() ,0,0);
KOTAExcelReporter.xlInsert(types::String, row, 8, strfmt("%1",a));
b = time2str(timeNow()+60*60,0,0);
KOTAExcelReporter.xlInsert(types::String, row,11, strfmt("%1",b));
KOTAExcelReporter.xlShow();
}