Hi mubuso followers,
I have a question for my following problem and code. This code will export a Excel list with different Row's and information on different tables.
Now RowNo 6 and 14 will not set data and will be empty. Does someone knows why? Thanks for answer.
IF ExportToExcel THEN BEGIN
RowNo := RowNo + 1;
WITH ExcelBuf DO BEGIN
// Print Columnheaders.
IF RowNo = 1 THEN BEGIN
EnterCell(RowNo,1,'Test formulier',TRUE,FALSE);
RowNo := RowNo + 2;
EnterCell(RowNo,1,'Status',TRUE,FALSE);
EnterCell(RowNo,2,'Productieorder',TRUE,FALSE);
EnterCell(RowNo,3,'Vestiging',TRUE,FALSE);
EnterCell(RowNo,4,'Bew.plannr.',TRUE,FALSE);
EnterCell(RowNo,5,'Artikelnr.',TRUE,FALSE);
EnterCell(RowNo,6,'Productielijn',TRUE,FALSE);
EnterCell(RowNo,7,'Omschrijving',TRUE,FALSE);
EnterCell(RowNo,9,'Begindatum',TRUE,FALSE);
EnterCell(RowNo,10,'Aantal',TRUE,FALSE);
EnterCell(RowNo,11,'Kosten',TRUE,FALSE);
EnterCell(RowNo,12,'Bedrag',TRUE,FALSE);
EnterCell(RowNo,13,'Opmerkingen',TRUE,FALSE);
EnterCell(RowNo,14,'Sorteringregelnummer',TRUE,FALSE);
RowNo := RowNo + 1;
END;
// Export Data
EnterCell(RowNo,1,FORMAT (Status),FALSE,FALSE);
EnterCell(RowNo,2,"Prod. Order No.",FALSE,FALSE);
EnterCell(RowNo,3,"Location Code",FALSE,FALSE);
EnterCell(RowNo,4,"Routing No.",FALSE,FALSE);
EnterCell(RowNo,5,"Item No.",FALSE,FALSE);
EnterCell(RowNo,6,FORMAT (ProductionBatchLine."Prod. Batch No."),FALSE,FALSE);
EnterCell(RowNo,7,Description,FALSE,FALSE);
EnterCell(RowNo,8,"Description 2",FALSE,FALSE);
EnterCell(RowNo,9,FORMAT ("Starting Date"),FALSE,FALSE);
EnterCell(RowNo,10,FORMAT (Quantity),FALSE,FALSE);
EnterCell(RowNo,11,FORMAT (LineCost),FALSE,FALSE);
EnterCell(RowNo,12,FORMAT (LineAmount),FALSE,FALSE);
EnterCell(RowNo,13,ProductionOrder.Remark,FALSE,FALSE);
EnterCell(RowNo,14,FORMAT (ProductionBatchLine."Sorting Line No."),FALSE,FALSE);
0
Answers
You need a "GET"
https://msdn.microsoft.com/en-us/library/dd301056.aspx
http://www.BiloBeauty.com
http://www.autismspeaks.org
EnterCell(RowNo,6, ProductionBatchLine.GET('Prod. Batch No.'),FALSE,FALSE);
I just edit this line and it will give a type conversion message back.
ProductionBatchLine.GET(<key fields>);
EnterCell(RowNo,6,FORMAT (ProductionBatchLine."Prod. Batch No."),FALSE,FALSE);
...
after that also line 14 should be exported correctly.
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/
ProductionBatchLine.GET(Status);
EnterCell(RowNo,14,FORMAT (ProductionBatchLine."Sorting Line No."),FALSE,FALSE);
will give me " For the expression Option can no type conversion to be performed to a code value. "