Brother labelprinter automation problem (Navision crash)

Hi everybody,

Did someone ever tried to link Navision to a Brother QL-580N labelprinter by using the P-Touch / b-PAC SDK automation (also delivered by Brother) ?
Labels are configured in the P-Touch software and the templates are then used for printing data from Navision.

This could be the code:

CREATE(autLabelDocG);
autLabelDocG.Open(‘c:\item.lbx’); //This is the template created in P-Touch

intIndexG := autLabelDocG.GetTextIndex(‘Barcode’); //‘Barcode’ is a text label in the template
autLabelDocG.SetText(intIndexG,’’+item.“No.”+’’); //‘Barcode’-text is now replaced by the item number

autLabelDocG.StartPrint(‘test’,0);
autLabelDocG.PrintOut(1,0);
autLabelDocG.EndPrint;
autLabelDocG.Close;
CLEAR(autLabelDocG);

This works fine if I look at the result coming out of the printer, but Navision crashes every time the code runs.
An “internal error”-message appears (without module-no.).

Strange thing is that the error only occurs when the complete code is executed. So I can debug my complete object (with multiple printouts if needed) and during the last step in my debugger the internal error occurs.
The tests were done on Navision 3.70 and NAV2009.

Does anybody have experience with this ?

Thank you very much in advance for your replies.

Tom

Question, Does NAV crashes ONLY when printing batches ? does it work fine when printing a single report(page) ?

Try to close your NAV client and delete the ZUP file. And test again, sometimes the ZUP file store some stuffs that make NAV crashes on some processes.

Hi Tarek,

Thank you very much for your reply.
I just removed the ZUP-file and tried again…same problem :-).

It is not only when runing batches. I inserted the code above in a codeunit where I called 1 item record.