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

CSV file from a report

(0) ShareShare
ReportReport
Posted on by 47

I need to develop a report that the End User can initiate so that the Check Ledger Entry table is sorted by Check Date. I have all of my columns needed by the Bank, and I have been able to get all of the data exactly the way I want it. The issue I am having is I cannot figure out how to get the code written to export each line as a CSV. I cannot have it as one long line of data, I need it be line for line just as it is in the Check Ledger Entry table. I have been playing around with different code and some help I found on this site from 2016 but I keep running into issues with trying to write the file to a folder on the C:\ drive. Below is all of the code that I have as well as the fields from the Check Ledger Entry table I am using.

Documentation()

OnInitReport()

OnPreReport()

OnPostReport()

Check Ledger Entry - OnPreDataItem()

Check Ledger Entry - OnAfterGetRecord()
"Check Ledger Entry".Description:= (DELCHR("Check Ledger Entry".Description, '=' , ','));

IF "Check Ledger Entry".Amount <> 0 THEN
  AccountNo := '267104';

IF "Check Ledger Entry".Amount <> 0 THEN
  IF "Check Ledger Entry"."Entry Status" = 1 THEN //VOIDED
    TransCode := 'VD';

IF "Check Ledger Entry".Amount <> 0 THEN
  IF "Check Ledger Entry"."Entry Status" = 2 THEN //POSTED
    TransCode := 'IA';

IF "Check Ledger Entry".Amount <> 0 THEN
  IF "Check Ledger Entry"."Entry Status" = 3 THEN //FINANCIALLY VOIDED
    TransCode := 'VA';

Always28:= '28';

Create('C:\Users\t.harkness\Documents\test.csv');
Write(ItxLine:= ItxLine   "Check No."   FORMAT("Check Ledger Entry"."Check Date", 0));

Check Ledger Entry - OnPostDataItem()

5758.Fields.pngCAL-Globals.png

I have the same question (0)
  • Suggested answer
    Brian Wick Profile Picture
    Microsoft Employee on at

    Hi Troy,

    We currently do not have dedicated Dev support via the NAV/Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    https://mibuso.com/

    I will open this up to the community in case they have something to add.

    Thanks-

  • troyh1968 Profile Picture
    47 on at

    Thank you for the information Brian. I will take a look.

    Troy

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 March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,993 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,116 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans