Fast Report - Share Text Message - WhatsApp

From eStream Software
Revision as of 08:03, 5 November 2018 by Twfaung (talk | contribs) (Created page with "==Introduction== From Version 849.768 & above user can Share the report to WhatsApp, Skype, Line & etc ==Requirement== * Fast Report * WhatsApp, Skype, Line & etc Login * SQL...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

From Version 849.768 & above user can Share the report to WhatsApp, Skype, Line & etc

Requirement

  • Fast Report
  • WhatsApp, Skype, Line & etc Login
  • SQL Accounting Version 849.768 & above

Setting

Below is example using Sales Invoice

FR-WhatsApp-01.jpg
01. Click the Code Tab
02. Scroll down look for procedure SetUp
03. Copy below script & paste it between the begin & end; in procedure SetUp
  SQL := 'SELECT B.Description As ReportName, B.Description3 As Body '+
         'FROM SL_QT A ' +
         'INNER JOIN SL_QTDTL B ON (A.Dockey=B.Dockey) ' +
         'WHERE A.DocNo=''WHATSAPP'' ' +
         'ORDER BY B.SEQ';
  AddDataSet('plShareMsg', ['ReportName', 'Body'])
  .GetDBData(SQL);
04. Click File | Save As... to save the file (eg Sales Invoice 8 (SST 2)-WhatApp)
05. Click File | Exit to exit the report design
06. Click Design again in the report designer for the file just save on Steps 5 (eg Sales Invoice 8 (SST 2)-WhatApp)
07. Click the Code Tab
08. Scroll down look for procedure function StrToFloatDef(const lFld:Variant):string
09. Copy below script & paste it above the function
procedure GetShareMsg;
var D  : TfrxDataSet;
   lFN : String;
begin
  lFN := Trim(Report.ReportOptions.Name);
  lFN := StringReplace(lFN,'.fr3','');
  D := Report.GetDataSet('plShareMsg');
  D.First;
  While not D.Eof do begin
    if Trim(D.Value('ReportName')) = lFN then
      Break;
    D.Next;
  end;
end;

function GetShareText: string;
begin
  GetShareMsg;
  Result := GetFldInfo(RichTextToPlainText(<plShareMsg."Body">))
end;