Skip to main content

Notifications

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 ?

  • AnandKrishna Profile Picture
    AnandKrishna 18 on at
    RE: Create multiple datasets using the same temp table in RDP class of a ssrs report

    Thanks for the reply

  • Verified answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Create multiple datasets using the same temp table in RDP class of a ssrs report

    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
    AnandKrishna 18 on at
    RE: Create multiple datasets using the same temp table in RDP class of a ssrs report

    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
    Arunraj Rajasekar Profile Picture
    Arunraj Rajasekar 1,731 on at
    RE: Create multiple datasets using the same temp table in RDP class of a ssrs report

    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

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,846 Most Valuable Professional on at
    RE: Create multiple datasets using the same temp table in RDP class of a ssrs report

    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.

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Create multiple datasets using the same temp table in RDP class of a ssrs report

    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,

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Create multiple datasets using the same temp table in RDP class of a ssrs report

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

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans