Options

Email the Report PDF & Print

rathin_mcarathin_mca Member Posts: 14
edited 2013-11-22 in NAV Three Tier
The requirement is while running Customer Statement Report (116) i want to send email as pdf customer who are all have the email id . if customer dnt have email automaticllly report should print normaly from printer.

for emailing part am ok.

how should i automate to print if customer dont have email id..?

Any idea on this requirement...?

thanks ,
Rathin

Comments

  • Options
    Rob_HansenRob_Hansen Member Posts: 296
    My response is obviously biased here, but I would recommend looking at add-on products for this and not reinventing the wheel. We have our own product called DocumentPath that meets this requirement and has a very rapid rollout (automatic integration into a NAV database, no outside components to configure). We are a mibuso sponsor and you can download the product fact sheet here: http://www.mibuso.com/pdinfo.asp?FileID=370

    If you want more details on the Customer Statement distribution process, PM me and I have some further documentation.

    If you decide to reinvent the wheel and just want to customize this, then the approach would basically be to create a processing report to loop through all customers. For each customer, call the statement report either using SAVEASPDF if they have an email address, or print it if they don't. You'll need to pass settings from the processing report (statement options) through to the actual statement report. Our product also includes copies of all open invoices with each statement to eliminate the customer calling to say they're missing invoice(s) and someone having to re-send them (time consuming).
  • Options
    manikandanmanikandan Member Posts: 160
    rathin_mca wrote:
    The requirement is while running Customer Statement Report (116) i want to send email as pdf customer who are all have the email id . if customer dnt have email automaticllly report should print normaly from printer.

    for emailing part am ok.

    how should i automate to print if customer dont have email id..?

    Any idea on this requirement...?

    thanks ,
    Rathin
    Hi Ratin,

    CLEAR(CustEmail);
    CLEAR(CompanyEmail);
    lCompInfo.GET();
    CompanyEmail := lCompInfo."E-Mail";
    lSalHead.RESET;
    lSalHead.SETRANGE("Document Type",SalesHeader."Document Type");
    lSalHead.SETRANGE("No.",SalesHeader."No.");
    REPORT.SAVEASPDF(50002, 'E:\reports\default.pdf', lSalHead);
    Cust.GET(SalesHeader."Sell-to Customer No.");
    CustEmail := Cust."E-Mail";
    IF RespCenter.GET(SalesHeader."Responsibility Center") THEN
    lResCentermail := RespCenter."E-Mail";
    IF lResCentermail <>'' THEN
    lccMail := lResCentermail +';'+CompanyEmail
    ELSE
    lccMail := CompanyEmail;
    IF CustEmail <>'' THEN BEGIN
    CLEAR(DespatchInfo);
    SalOrderAck := TRUE;
    Mail.NewMessage(CustEmail,lccMail,STRSUBSTNO('Sale Order Acknowledgement %1',"No."),'',
    "3Tier".DownloadTempFile('E:\reports\default.pdf'),FALSE);
    END;
    In Here Mail is variable indicates codeunit :
    Note:SAVEASPDF function works only RDLC Report.
    :thumbsup:
Sign In or Register to comment.