web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Not able to retrieve data from Bank acc. reconcilation Table

(0) ShareShare
ReportReport
Posted on by 72

Hi Team,

I have just created one test report with data item as Bank acc. reconciliation(Table 273).In this report i just need to display bank account field .but i am not getting field value from table.can any one suggest how to achieve this?.below screenshot for table 273

pastedimage1581440473926v1.png

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,278 Super User 2026 Season 1 on at

    Can you share the report code you have used to retrieve the bank account no?

  • Nitesh bhoir Profile Picture
    72 on at

    Hello sir,

    My requirement is i want to import 2 fields from table No.273 (i.e Bank account No,statement No.) and other fields from excel into bank acc. reconciliation line table.For this i have created and report .PFB code for the same.

    Documentation()

    OnInitReport()

    OnPreReport()
    {
    ExcelBuffer.LOCKTABLE;
    ExcelBuffer.OpenBook(ServerFilename,SheetName);
    ExcelBuffer.ReadSheet;
    GetLastRowandColumn;

    FOR X:=14 TO Totalrows DO
    InsertData(X);
    ExcelBuffer.DELETEALL;
    MESSAGE('Import Completed.');
    }

    OnPostReport()

    Bank Acc. Reconciliation - OnPreDataItem()

    Bank Acc. Reconciliation - OnAfterGetRecord()

    Accountnovar:="Bank Acc. Reconciliation"."Bank Account No.";
    Statementvar:="Bank Acc. Reconciliation"."Statement No.";
    //MESSAGE(Accountnovar);
    //MESSAGE(Statementvar);
    ExcelBuffer.LOCKTABLE;
    ExcelBuffer.OpenBook(ServerFilename,SheetName);
    ExcelBuffer.ReadSheet;
    GetLastRowandColumn;

    FOR X:=14 TO Totalrows DO
    InsertData(X);
    ExcelBuffer.DELETEALL;
    MESSAGE('Import Completed.')

    Bank Acc. Reconciliation - OnPostDataItem()

    Excel Buffer - OnPreDataItem()

    Excel Buffer - OnAfterGetRecord()

    Excel Buffer - OnPostDataItem()

    GetLastRowandColumn()
    ExcelBuffer.SETRANGE("Row No.",1);
    Totalcolumn:=ExcelBuffer.COUNT;
    ExcelBuffer.RESET;
    IF ExcelBuffer.FINDLAST THEN
    Totalrows:=ExcelBuffer."Row No.";

    OpenBook(FileName : Text;SheetName : Text[250])
    IF FileName = '' THEN
    ERROR(Text001);
    IF FileName = '' THEN
    ERROR(Text002);


    XlWrkBkReader := XlWrkBkReader.Open(FileName);
    IF XlWrkBkReader.HasWorksheet(SheetName) THEN BEGIN
    XlWrkShtReader := XlWrkBkReader.GetWorksheetByName(SheetName);
    END ELSE BEGIN
    QuitExcel;
    ERROR(Text004,SheetName);
    END;

    QuitExcel()

    // Close and clear the OpenXml book
    CloseBook;

    // Clear the worksheet automation
    IF NOT ISNULL(XlWrkSht) THEN
    CLEAR(XlWrkSht);

    // Clear the workbook automation
    IF NOT ISNULL(XlWrkBk) THEN
    CLEAR(XlWrkBk);

    // Clear and quit the Excel application automation
    IF NOT ISNULL(XlApp) THEN BEGIN
    XlHelper.CallQuit(XlApp);
    CLEAR(XlApp);
    END;

    CloseBook()

    IF NOT ISNULL(XlWrkBkWriter) THEN BEGIN
    XlWrkBkWriter.ClearFormulaCalculations;
    XlWrkBkWriter.ValidateDocument;
    XlWrkBkWriter.Close;
    CLEAR(XlWrkShtWriter);
    CLEAR(XlWrkBkWriter);
    END;

    IF NOT ISNULL(XlWrkBkReader) THEN BEGIN
    CLEAR(XlWrkShtReader);
    CLEAR(XlWrkBkReader);
    END;

    InsertData(RowNo : Integer)

    BankaccReconciline."Statement Line No." +=10000;
    //EVALUATE(BankaccReconciline."Statement Line No.",GetvalueAtCell(RowNo,1));
    EVALUATE(BankaccReconciline."Transaction Date",GetvalueAtCell(RowNo,2));
    EVALUATE(BankaccReconciline.Description,GetvalueAtCell(RowNo,3));
    EVALUATE(BankaccReconciline."Check No.",GetvalueAtCell(RowNo,5));

    IF GetvalueAtCell(RowNo,6) <> '' THEN
    //bgk := GetvalueAtCell(RowNo,6)) * -1
    EVALUATE(BankaccReconciline."Statement Amount",GetvalueAtCell(RowNo,6))
    ELSE
    IF GetvalueAtCell(RowNo,7) <> '' THEN BEGIN
    EVALUATE(BankaccReconciline."Statement Amount",GetvalueAtCell(RowNo,7));
    BankaccReconciline."Statement Amount":=BankaccReconciline."Statement Amount"*(-1);
    END;
    {
    IF GetvalueAtCell(RowNo,6) = '' THEN
    //bgk := GetvalueAtCell(RowNo,6)) * -1
    EVALUATE(BankaccReconciline."Statement Amount",GetvalueAtCell(RowNo,7));

    IF GetvalueAtCell(RowNo,7) = '' THEN
    EVALUATE(BankaccReconciline."Statement Amount",GetvalueAtCell(RowNo,6));
    }

    //EVALUATE(BankaccReconciline."Applied Amount",GetvalueAtCell(RowNo,7));
    EVALUATE(BankaccReconciline."Value Date",GetvalueAtCell(RowNo,9));
    BankaccReconciline."Bank Account No." := Accountnovar;
    BankaccReconciline."Statement No." :=Statementvar;

    BankaccReconciline.INSERT(TRUE);

    GetvalueAtCell(RowNo : Integer;Column : Integer) : Text
    IF NOT ExcelBuffer1.GET(RowNo,Column)
    THEN EXIT('') ELSE
    EXIT(ExcelBuffer1."Cell Value as Text");
    {
    ExcelBuffer1.GET(RowNo,Column);
    EXIT(ExcelBuffer1."Cell Value as Text");
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,059 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 994 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 664 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans