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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to populate a Temporary Table in a report from a Query

(6) ShareShare
ReportReport
Posted on by 683
Relatively new to BC coding using AL.  I have created a Query that I use to populate a Temp Table, which is then used to build a Page.  I followed this link, which was extremely helpful.  https://yzhums.com/4869/
 
I have also used the Query to create an RDLC report, which works great, but as I understand it, you cannot define Report Filters when the DataSet is a Query.
 
So I would like to use the Query to load data into the Temp Table so I can utilize the Report Filters.
 
I am trying to use the OnPreReport trigger in the report.al file, but the table is empty (apparently) as I get an error saying there is no data in the report.
 
Not sure what I am missing, but does anyone have some sample code I can review to see how this is done?
 
I am attaching the Query, Temp Table, and report.al (based on the Query) that I have so far.
I have the same question (0)
  • ME-31032107-0 Profile Picture
    683 on at
    I forgot to attach the files, here they are.  Thanks.
  • Suggested answer
    YUN ZHU Profile Picture
    95,548 Super User 2025 Season 2 on at
    Hi, hope the following helps.
    Dynamics 365 Business Central: How to use a query to create a report dataset (Creating Report with Query)
     
    As for filtering, you can try adding it to the trigger below.
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,439 Super User 2025 Season 2 on at
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,439 Super User 2025 Season 2 on at
    I can see the value in report
     
  • ME-31032107-0 Profile Picture
    683 on at
    , thanks for your reply.  I am not trying to filter the dataset, but rather have the ability for the report to add a filter in the UI, like when using the RequestFilterFields = "No.".  When I try to use it, I get the error "Reference No. in application object Integer does not exist".
  • ME-31032107-0 Profile Picture
    683 on at
    , I have read that article and am trying to replicate it, but it is not working.  If you were successful, can you share your code so I can see what I am missing?
  • Verified answer
    Gerardo Rentería García Profile Picture
    25,225 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    How to design a high performant inventory report in Business Central - D365 Business Central Freelance Developer

    Best Regards
    Gerardo

  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,439 Super User 2025 Season 2 on at
  • ME-31032107-0 Profile Picture
    683 on at
    , thank you.  Your post was very helpful to me being able to get what I needed.  Thanks!!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans