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 :
Finance | Project Operations, Human Resources, ...
Answered

Missing "Records to include" tab in SSRS report dialog

(1) ShareShare
ReportReport
Posted on by 843

I am creating an SSRS report that will display all production orders. I want to be able to filter the data through the filters on the "Records to include" tab.
Unfortunately, despite my efforts, the tab is not visible. What should I do to be able to use it?

I use this documentation: https://docs.microsoft.com/en-us/dynamicsax-2012/appuser-itpro/how-to-use-a-report-data-provider-class-in-a-report?redirectedfrom=MSDN

I removed the contract class because I don't need any input parameters. I just want to have filtering available in "Records to include".

1. I created a query, to which I added ProdTable

321312.png

2. DP class

[
     SRSReportQueryAttribute('MyQuery')
 ]
 public class myDPclass extends SRSReportDataProviderBase
{
    MyReportTmp myReportTmp;

        
    [SrsReportDataSetAttribute('MyReportTmp')]
    public MyReportTmp getData()
    {
        select * from myReportTmp;

        return myReportTmp;
    }

    public void processReport()
    {
        Query                   query;
        QueryRun                qr;
        QueryBuildDataSource    queryBuildDataSource;
        QueryBuildRange         queryBuildRange;
        ProdTable               queryProdTable;
    
        // Get the query from the runtime using a dynamic query.
        query = this.parmQuery();

        // Add parameters to the query.
        queryBuildDataSource = query.dataSourceTable(tablenum(ProdTable));
            
        // Run the query with modified ranges.
        qr = new QueryRun(query);
        ttsbegin;
        while(qr.next())
        {
            myReportTmp.clear();
            queryProdTable = qr.get(tablenum(ProdTable));
            myReportTmp.itemId = queryProdTable.ItemId;
            myReportTmp.itemName = queryProdTable.Name;
            myReportTmp.insert();
        }
        ttscommit;
    }

}

3.I created a simple report design and connected it to the menu item. The running dialog has parameters that I don't need, and the "Records to include" tab is not available.

Zrzut-ekranu-2022_2D00_09_2D00_16-152215.png

What am I doing wrong?

Thanks.

I have the same question (0)
  • Suggested answer
    Komi Siabi Profile Picture
    13,093 Most Valuable Professional on at

    To enable the records to include you would need to go the dataset on the report and change the Dynamic filter property to True.

    As for the parameter,

    check the parameter node on the report and deleted those parameters.

    Build and redeploy report then test.

  • Shooowtek Profile Picture
    843 on at

    Thank you Komi Siabi.

    How can I decide which fields are available in "Records to include"?

  • Suggested answer
    Komi Siabi Profile Picture
    13,093 Most Valuable Professional on at

    Hi Shooowtek,

    Ideally, the fields you have available on query object used in the report are displayed on the records to include. You can control this on the query by setting the Dynamic fields to No and remove the fields you don't want to be available.

  • Shooowtek Profile Picture
    843 on at

    Thank you Komi Siabi,

    I would like to perform some calculations and conditions on the received data. At what point is it best to do this?

    Should I perform the calculations and conditions in the processReport method after receiving the data from the query, before writing to the temporary table?

  • Suggested answer
    Komi Siabi Profile Picture
    13,093 Most Valuable Professional on at

    Hi Shooowtek,

    Yes please, you should do your computation based on condition in the processReport method.

  • Shooowtek Profile Picture
    843 on at

    Thanks Komi Siabi,

    I think this approach is a bit illogical and complicated. Could you describe to me how I should approach my problem?

    Namely, I am trying to create a report that is based on three related tables: ProdTable, ProdBOM and InventTable. I want to retrieve data (filtered by appropriate conditions) and perform calculations on it. This is the only data I want to put on the report.

    Normally, I would handle this problem by creating a DP class and writing the appropriate SELECT query in the processReport() method, and then storing this data in a tmp table, which would be the source for the report. But unfortunately, this way the report does not have the ability to have a "Records to include" tab available, so I have to create a new item in Visual studio->Add->new item->query and add my three required tables to it?

    How can I work on this data later to get a similar effect as writing an efficient single SELECT query? How can I handle such a multivariate and complex query that additionally says filtering capabilities via the "records to include" tab?

    Can I create a class in the created query where I can insert SELECT and thus define this query?

    Example of the data I want to get:
    The production order number (ProdBOM) of the product , the items from the BOM that have the unity 'KG' (ProdBOM), and the name and some of the paramaters of those items (InventTable)

    query item:

    5314.q.png

    I know that you can work with a query in this way, such as adding a range: http://daxingwitheshant.blogspot.com/2019/03/dynamic-query-in-x.html, but is this the best and only way?

    Thanks a lot for all the suggestions. Please be understanding asI am a beginner and I don't have much experience.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans