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

Create multiple datasets using the same temp table in RDP class of a ssrs report

(0) ShareShare
ReportReport
Posted on by 18

Hi all

I am using D365F&O

When we create a RDP class  for a ssrs report we use 

[SRSReportDataSetAttribute("TempTable")]
public TempTable getTempTable()
{
   select * from _tempTable ;
   return _tempTable ;
}

which reflects while creating datasets in the report.

My question is how can i create multiple data sets using the same TempTable but different conditions. What I tired didnt work was : - 

[SRSReportDataSetAttribute("TempTable")]
public TempTable getTempTable()
{
   select * from _tempTable where _tempTable.Field == Value ;
   return _tempTable ;
}

[SRSReportDataSetAttribute("TempTable")]
public TempTable getTempTable()
{
   select * from _tempTable  where _tempTable.Field != Value ;
   return _tempTable ;
}

Can someone please suggest how I can make this logic work ?

  • Mohit Rampal Profile Picture
    12,573 Moderator on at

    Hi Anand, Why do you want to create multiple datasets for same table. Can we have more details on requirement.

  • GirishS Profile Picture
    27,843 Moderator on at

    Hi Anand,

    You cannot use same temp table more than once. If you want, you can create separate temp table and use that.

    Can you elaborate what functionality you are trying to achieve.

    Thanks,

    Girish S,

  • Verified answer
    Martin Dráb Profile Picture
    240,827 Most Valuable Professional on at

    Note that you should be able to use the same type, e.g. TempTable, but two different buffers and data sets:

    [SRSReportDataSetAttribute("TempTable1")]
    public TempTable getTempTable1()
    {
    	select * from tempTable1; // A buffer populated with records where Field == Value
    	return tempTable1;
    }
    
    [SRSReportDataSetAttribute("TempTable2")]
    public TempTable getTempTable2()
    {
    	select * from tempTable2; // A buffer populated with records where Field != Value
    	return tempTable2;
    }

    By the way, note that the only variables that should use _ as the prefix are method parameters.

  • Verified answer
    Arunraj Rajasekar Profile Picture
    1,743 on at

    Hi AnandKrishna,

    Let me elaborate Martin's answer.

    When you include the RDP class in report design, you will have the option to select methods that have SRSReportDataSetAttridute.  On selecting the method it will return the values stored in the temp table.

    Coming to data provider class, you have to declare two buffers for the same temp table and store values as per the required criteria. Now the dataset will return

  • AnandKrishna Profile Picture
    18 on at

    I have a requirement where I have a parameter. If the parameter is off I need to show all transactions if the parameter is on then I need to show invoiced and non invoiced transactions in separate tables

    ( if opened in excel then in 2 sperate sheets). Since the data in either case is the same, I wanted to know if I could create multiple datasets based on conditons.

    I know I can complete this requirement either by hiding the rows at design level or create 2 separate temp table for 2 cases.

  • Verified answer
    GirishS Profile Picture
    27,843 Moderator on at

    My suggestion will be instead of multiple dataset you can have multiple design - You can add logic in the controller class to specify the report design based on the parameter selection.

    Just create an Enum field in the temp table and while inserting transactions, add the Enum field values to identify the invoiced and non-invoiced transaction.

    So, the first design will show all the transactions. Second design will have two Tablix - On each Tablix property you can add the Enum field value to filter based on that. (Invoiced and non-invoiced transaction).

    You can refer to standard PayrollPayStatementReport for filtering grids based on the temp table field values.

    Thanks,

    Girish S,

  • AnandKrishna Profile Picture
    18 on at

    Thanks for the reply

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 495 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 432 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 366

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans