Hi all,
While exporting data from Report to excel sheet i got error as"Date is not valid"
in my Report there are Order date,Promised delivery date and Requested del date are the columns.
I have used below code in Sales Header- On Post dataItem()
CREATE(xlApp);
xlBook := xlApp.Workbooks.Add;
xlSheet:= xlApp.ActiveSheet;
xlSheet.Name := ‘Booking’;
ExcelBuf.NewRow;
RowId:=1;
xlSheet.Range(‘A1’).Value:=“Sales Header”.FIELDCAPTION(“Order Date”);
xlSheet.Range(‘B1’).Value:=“Sales Header”.FIELDCAPTION(“Requested Delivery Date”);
xlSheet.Range(‘C1’).Value:=“Sales Header”.FIELDCAPTION(“Promised Delivery Date”);
IF"Sales Header".“Sell-to Customer No.”<> ‘’ THEN
BEGIN
REPEAT
RowId:=RowId+1;
xlSheet.Range(‘A’+FORMAT(RowId)).Value:=“Sales Header”.“Order Date.”;
xlSheet.Range(‘B’+FORMAT(RowId)).Value:=“Sales Header”.“Requested Delivery Date”;
xlSheet.Range(‘C’+FORMAT(RowId)).Value:=“Sales Header”.“Promised Delivery Date”;
UNTIL NEXT = 0;
END;
xlSheet.Columns.AutoFit;
xlApp.Visible := TRUE;
xlBook.SaveAs(‘C:\Users\sudheerbabu.sadagana\Desktop\Book.xls’);
Is there any thing in need to add…
Thanks in Advance,.