How to schedule a report to run everyday at a particulartime

Markandey_PandeyMarkandey_Pandey Member Posts: 178
Hi all,

Can we schedule a report to run everyday at a particular time.

can anybody guide me.
Markandey Pandey

Comments

  • lvanvugtlvanvugt Member Posts: 774
    Use the Job Queue.

    Administration > Application Setup > Job Queue
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Denis_PetrovDenis_Petrov Member Posts: 107
    What would be the best way to run AND email a report on a regular basis?
    Best regards,

    Denis Petrov.
  • KYDutchieKYDutchie Member Posts: 345
    lvanvugt wrote:
    Use the Job Queue.

    Administration > Application Setup > Job Queue
    Use the Job Queue.

    Administration > Application Setup > Job Queue

    Put a call to your report into a codeunit and save as HTML.
    The codeunit could then generate and send an email. You could either stream the report html output into the email or attach the HTML file to the Email.

    This codeunit could be executed by the Job Queue.

    Hope this helps,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • dndn Member Posts: 71
    U have to verify that u have license for Job Que first.
  • Denis_PetrovDenis_Petrov Member Posts: 107
    KYDutchie wrote:
    lvanvugt wrote:
    Use the Job Queue.

    Put a call to your report into a codeunit and save as HTML.
    The codeunit could then generate and send an email. You could either stream the report html output into the email or attach the HTML file to the Email.

    Willy

    would you please share the exact code
    thanks
    Best regards,

    Denis Petrov.
  • KYDutchieKYDutchie Member Posts: 345
    Dennis,

    it really is pretty easy here is some code that I created to email an error log after an automated sales post batch :
    //Send the log to Accounting:
    tsSMTPSetup.GET;
    SMTPMail.CreateMessage(tsSMTPSetup."Accounting Name",
                           tsSMTPSetup."Accounting email address",
                           tsSMTPSetup."Accounting email address",
                           'Sales Invoice Batch Log','',TRUE);
    tsLog.RESET;
    tsLog.SETRANGE(Date,TODAY);
    IF tsLog.FINDSET THEN BEGIN
      tsLogReport.SETTABLEVIEW(tsLog);
      tsLogReport.SAVEASHTML('c:\SalesBatchLog.HTML');
      tsfile.TEXTMODE(TRUE);
      IF tsfile.OPEN('c:\SalesBatchLog.HTML') THEN BEGIN
        tsfile.SEEK(0);
        REPEAT
          tsfile.READ(tsErrorText);
          SMTPMail.AppendBody(tsErrorText);
        UNTIL tsfile.POS = tsfile.LEN;
      END;
      SMTPMail.Send;
      tsfile.CLOSE;
      ERASE('c:\SalesBatchLog.HTML');
    END;
    

    I know this is a bad example by hardcoding and using the 'c:\' but that is what the customer wanted.

    Regards,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
Sign In or Register to comment.