110
app.OlePropertySet("visible",true);
//
Excelni
ko’rinishini
taminlash uchun
app.OlePropertySet("SheetsInNewWorkbook",3); //
Yangi ishchi kitob
sozlash
books=app.OlePropertyGet("WorkBooks"); //
Yangi ishchi kitob xosil
qilish
books.OleProcedure("Add"); //open widestring
book=books.OlePropertyGet("Item",1); //
ma’lum bir kitob belgilab
olinadi
sheets=book.OlePropertyGet("WorkSheets");
sheet=sheets.OlePropertyGet("Item",1);
sheet.OlePropertySet("Name",WideString("Hisobot"));//
kitobda
Hisobot
nomli sahifa ochildi
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",1,1);
cell.OlePropertySet("Value",WideString("Hisobot"));
//jadval
ustunlari sarlovhasi yaratiladi
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",2,1);
cell.OlePropertySet("Value",WideString("FISH"));
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",2,2);
cell.OlePropertySet("Value",WideString("Tug'ilgan yili"));
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",2,3);
cell.OlePropertySet("Value",WideString("Kursi"));
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",2,4);
cell.OlePropertySet("Value",WideString("Guruhi"));
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",2,5);
cell.OlePropertySet("Value",WideString("Manzili"));
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",2,6);
cell.OlePropertySet("Value",WideString("Telefon raqami"));
ADOTable1->First();
for (int i=0; i
RecordCount; i++)
{
fish=ADOTable1->FieldByName("fish")->AsString;
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",i+3,1);
cell.OlePropertySet("Value",WideString(fish));
ty=ADOTable1->FieldByName("ty")->AsVariant;
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",i+3,2);
cell.OlePropertySet("Value",WideString(ty));
kurs=ADOTable1->FieldByName("kurs")->AsVariant;
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",i+3,3);
cell.OlePropertySet("Value",WideString(kurs));
guruh=ADOTable1->FieldByName("guruh")->AsVariant;
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",i+3,4);
cell.OlePropertySet("Value",WideString(guruh));
manzil=ADOTable1->FieldByName("manzil")->AsVariant;
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",i+3,5);
cell.OlePropertySet("Value",WideString(manzil));
tel=ADOTable1->FieldByName("tel")->AsVariant;
111
cell=sheet.OlePropertyGet("Cells").OlePropertyGet("Item",i+3,6);
cell.OlePropertySet("Value",WideString(tel));
ADOTable1->Next();
}
Hisobot tugmasi bosilganda ma’lumotlar MS Excel ga quyidagicha
jo’natiladi:
Hisobotni Microsoft Excell dasturida ko’rinishi.