When I run a report that exports data to excel it stops at 999 lines.
Have anyone a solution
this is the code i use
CREATE(xlApp);
xlBook :=xlApp.Workbooks.Add(-4167);
xlSheet:=xlApp.ActiveSheet;
xlSheet.Name:='Mailing';
IF Contact.Name = '' THEN BEGIN ERROR('Geen relatienaam bekend.')END ELSE BEGIN
//Colom headers
xlSheet.Range('a1').Value := FORMAT('relatienummer');
xlSheet.Range('b1').Value := ('bedrijfsnaam');
xlSheet.Range('c1').Value := ('Adres');
xlSheet.Range('d1').Value := ('Postcode');
xlSheet.Range('e1').Value := ('Plaats');
xlSheet.Range('f1').Value := ('Postbusnummer');
xlSheet.Range('g1').Value := ('Postbus postcode');
xlSheet.Range('h1').Value := ('Postbus plaats');
xlSheet.Range('i1').Value := ('telefoonnummer');
xlSheet.Range('j1').Value := ('faxnummer');
//xlsheet.range('k1').value := ('telefoonnummer');
//xlsheet.range('l1').value := ('telefoonnummer');
//xlsheet.range('m1').value := ('telefoonnummer');
//xlsheet.range('n1').value := ('telefoonnummer');
//xlsheet.range('o1').value := ('telefoonnummer');
xlApp.Visible :=TRUE;
// variabele data
Number := 1;
IF Contact.FIND('-') THEN BEGIN
REPEAT
Number := Number +1;
nummer:=FORMAT(Number);
xlSheet.Range('a'+nummer).Value := Contact."No.";
xlSheet.Range('b'+nummer).Value := Contact."Company Name";
xlSheet.Range('c'+nummer).Value := Contact.Address;
xlSheet.Range('d'+nummer).Value := Contact."Post Code";
xlSheet.Range('e'+nummer).Value := Contact.City;
IF Contact.PostbusNummer <>'' THEN BEGIN
xlSheet.Range('f'+nummer).Value := 'Postbus '+Contact.PostbusNummer;
xlSheet.Range('g'+nummer).Value := Contact.PostbusPostcode;
xlSheet.Range('h'+nummer).Value := Contact.PostbusPlaats;
END ELSE BEGIN
END;
xlSheet.Range('i'+nummer).Value := Contact."Phone No.";
xlSheet.Range('j'+nummer).Value := Contact."Fax No.";
//xlsheet.range('k'+nummer).value := contact."no.";
//xlsheet.range('l'+nummer).value := contact."no.";
//xlsheet.range('m'+nummer).value := contact."no.";
//xlsheet.range('n'+nummer).value := contact."no.";
//xlsheet.range('o'+nummer).value := contact."no.";
UNTIL Contact.NEXT <=0;
END;
END
0
Comments
Solution: (Presuming that Number is an Integer...) Use 'standard format 2' in the format expression as follows: