4. Mai 2009 09:40
CREATE(Exapp);
Exapp.Visible := TRUE;
ExWorkbook := Exapp.Workbooks.Add(-4167);
Exsheet := Exapp.ActiveSheet;
Exsheet.Range('A1').Value := 'Monat';
Exsheet.Range('B1').Value := 'Anzahl Rechnung';
Invoice.RESET;
//Invoice.SETRANGE("Document Type",Invoice."Document Type"::Invoice); //order rechnungsfilter
FOR idx := 1 TO 12 DO BEGIN //12 ist gleich monate
dat := DMY2DATE(1,idx,DATE2DMY(TODAY,3));
Invoice.SETRANGE("Order Date",dat,CALCDATE('<CM>',dat));
CASE idx OF
1 :monthname := 'Januar';
2 :monthname := 'Februer';
3 :monthname := 'März';
4 :monthname := 'April';
5 :monthname := 'Mai';
6 :monthname := 'Juni';
7 :monthname := 'Juli';
8 :monthname := 'August';
9 :monthname := 'September';
10 :monthname := 'Oktober';
11 :monthname := 'November';
12 :monthname := 'December';
END;
Exsheet.Range('A' + FORMAT(idx + 1)).Value := monthname;
Exsheet.Range('B'+ FORMAT(idx + 1)).Value := Invoice.COUNT;
END;
Exrange := Exsheet.Range('A2:B13');
ExChart := ExWorkbook.Charts.Add;
ExChart.Name := 'Rechnungen';
ExChart.ChartWizard(Exrange, -4100,2,2,1,0,0,'Rechnung/ Monat','Monat','Anz. Rechnung');
4. Mai 2009 09:47