* Start new application
* Add a CxGrid to the form
* Add a ADOConnection and connect it to my Access Database (*.mdb)
* Add 2 ADOTables and 2 Datasources, connect the 2 datasources to their
ADOTable..
* Set the Connection for the ADOTables to the ADOConnection component
* Set the ‘Tablename’ property of the ADOTable components to the table
‘Master’ for ADOTable1 and to ‘Detail’ for ADOTable2
* Set the ‘IndexFieldName’ property of both ADOTables to ‘ID’
* Set both ADOTables ‘Active’ property to ‘True’
* Create a new ‘level’ in the grid and add a tableview to it
* Link the first view to Datasource1
* Link the second view to Datasource 2
* Use the ‘Create All Columns’ option on both levels to add the columns
* Set the ‘Detailkeyfield’ , ‘KeyfieldName’ and ‘MasterKeyFieldName’
properties for both levels everything to ‘ID’
Category: DELPHI
Cxgrid to excel
Önce uses kısmına cxgridexportlink ekle
SaveDialog1.DefaultExt:=’xls’;
If SaveDialog1.Execute then
begin
ExportGridToExcel(savedialog1.filename,cxgrid1,true,true,true,’xls’);
Delphi’de excel dosyası yaratmak
- Önce aşağıdakileri excel.pas olarak kaydet ve projeyi kaydet;
unit Excel;
interface
uses Windows, Activex;
// originally from Excel97.pas
// XlFileFormat constants
type
XlFileFormat = TOleEnum;
const
xlAddIn = $00000012;
xlCSV = $00000006;
xlCSVMac = $00000016;
xlCSVMSDOS = $00000018;
xlCSVWindows = $00000017;
xlDBF2 = $00000007;
xlDBF3 = $00000008;
xlDBF4 = $0000000B;
xlDIF = $00000009;
xlExcel2 = $00000010;
xlExcel2FarEast = $0000001B;
xlExcel3 = $0000001D;
xlExcel4 = $00000021;
xlExcel5 = $00000027;
xlExcel7 = $00000027;
xlExcel9795 = $0000002B;
xlExcel4Workbook = $00000023;
xlIntlAddIn = $0000001A;
xlIntlMacro = $00000019;
xlWorkbookNormal = $FFFFEFD1;
xlSYLK = $00000002;
xlTemplate = $00000011;
xlCurrentPlatformText = $FFFFEFC2;
xlTextMac = $00000013;
xlTextMSDOS = $00000015;
xlTextPrinter = $00000024;
xlTextWindows = $00000014;
xlWJ2WD1 = $0000000E;
xlWK1 = $00000005;
xlWK1ALL = $0000001F;
xlWK1FMT = $0000001E;
xlWK3 = $0000000F;
xlWK4 = $00000026;
xlWK3FM3 = $00000020;
xlWKS = $00000004;
xlWorks2FarEast = $0000001C;
xlWQ1 = $00000022;
xlWJ3 = $00000028;
xlWJ3FJ3 = $00000029;
xlExcel12 =50;
xlExcel8 = 56;
xlHtml = 44;
xlOpenXMLAddIn = 55;
xlOpenXMLTemplate = 54;
xlOpenXMLTemplateMacroEnabled = 53;
xlOpenXMLWorkbook = 51;
xlOpenXMLWorkbookMacroEnabled = 52;
xlTemplate8 = 17;
xlUnicodeText = 42;
xlWebArchive = 45;
xlWorkbookDefault = 51;
xlXMLSpreadsheet = 46;
implementation
end.
sonra usesa : comobj,excel ve buttona ;
procedure TForm1.Button1Click(Sender: TObject);
var
Excel: OleVariant;
begin
Excel := CreateOleObject('EXCEL.Application');
Excel.Application.Workbooks.Add;
Excel.Application.Workbooks[1].SaveAs('c:\test.xlsx', xlWorkbookDefault); // or xlOpenXMLWorkbook (51)
Excel.Application.Quit;
end;
CXGRID FOOTER
ÖNCE CXGRIDIN USTUNDEKI ALTINA CIKMASINI ISDEDIGIN COLUMNA TIKLA.(ÖRNEK AD)
SUMMARY KISMINDAN FOOTER KINDI SEÇ
SONRA CXGRIDIN UZERINDEKI CUSTOMIZEA TIKLA
VIEWSDAN CXGRID1DBTABLEVIEW1E TIKLA
EDIT VIEW LAYOUT AND DATAYA BAS
AD’A SAĞ TIKLA
FOOTER’A TIKLA
OK
Delphi xe6 Devexpress Install
component: DevExpress VCL v13.1.4 for XE5-XE6 Full
extract it
click for detail or below
Execute the script “Copy Resources RS20.cmd” hepsi d olacak
Open the project group “DevExpress XE6.groupproj” within Delphi XE6
Show the build group
Build the build group “Build all”
Select all design-time packages and install them.
Add the path below at the end of the “Library path”.
Code:
d:\DevExpress VCL\Library\RS20\Win32\release
Delphi Create Appointment
Uses Comobj;
procedure TForm1.cxButton1Click(Sender: TObject);
var
Outlook,objAppointment: OleVariant;
Mail: Variant;
const
olMailItem = $00000000;
olAppointmentItem = 1;
begin
try
Outlook := GetActiveOleObject('Outlook.Application');
objAppointment := Outlook.CreateItem(olAppointmentItem)
except
Outlook := CreateOleObject('Outlook.Application');
end;
objAppointment.Start := '4/11/2005 11:00 AM' ;
objAppointment.Duration := 60 ;
objAppointment.Subject := 'Scripting Guys Planning Session' ;
objAppointment.Body := 'Meet with Scripting Guys to discuss upcoming plans.' ;
objAppointment.Location := '44/2039' ;
objAppointment.ReminderMinutesBeforeStart := 15 ;
objAppointment.ReminderSet := True;
objAppointment.Save ;
end;