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 ?
Thanks for the reply
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,
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.
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
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.
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,
Hi Anand, Why do you want to create multiple datasets for same table. Can we have more details on requirement.
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156