high memory usage SAVEASPDF NAV2013

inva2kinva2k Member Posts: 10
edited 2015-03-16 in NAV Three Tier
Hi folks,

We want to archive our sales invoices using the SAVEASPDF opportunity of the regarding report. The job shall run in the job qeue at night. We got about 500 to 800 invoices every day and the memory usage of the nav instance handling the archive job gets up to 1,5 GB. We got no images in the DataSet.

This is our code to generate the PDFs.
SalesInvoiceHeader_LT.SETRANGE(Archived,FALSE);
IF SalesInvoiceHeader_LT.FINDSET THEN BEGIN
  REPEAT
    CLEAR(PrintSalesInvoice_LR);
    PrintSalesInvoiceHeader_LT.GET(SalesInvoiceHeader_LT."No.");
    PrintSalesInvoiceHeader_LT.SETRECFILTER;
    PrintSalesInvoice_LR.SETTABLEVIEW(PrintSalesInvoiceHeader_LT);
    IF PrintSalesInvoice_LR.SAVEASPDF('E:\Rechnungsarchiv\'+PrintSalesInvoiceHeader_LT."No."+'.pdf') THEN BEGIN
      PrintSalesInvoiceHeader_LT.GET(SalesInvoiceHeader_LT."No.");
      PrintSalesInvoiceHeader_LT.Archived := TRUE;
      PrintSalesInvoiceHeader_LT."Archived At" := CURRENTDATETIME;
      IF PrintSalesInvoiceHeader_LT.MODIFY THEN;
      Count_L += 1;
    END;
    CLEAR(PrintSalesInvoice_LR);
  UNTIL (SalesInvoiceHeader_LT.NEXT = 0);
END;

Is there any possibility to speed up the memory cleaning? I red about a patch for nav 2009 R2 that addresses an issues like that. But I couldn't find anything related to NAV 2013. Do you got any idea on how to controll the memory usage?

Kind Regards,
Thomas
Sign In or Register to comment.