Hi,
I have built a custom SSRS report in D365 - 10.0.27.
The report runs fine and returns my data without issue.
I have a data contract in use and a data query.
[SrsReportQueryAttribute(queryStr(MyTestQuery)), SRSReportParameterAttribute(classStr(MyTestContract))] class MyTestRDP extends SRSReportDataProviderBase
I have the above code declared at the beginning of my RDP class - everything appears to be correct in the code but when I execute the run of the report and debug, it would appear my data query is being loaded correctly but my data contract is not present in the parmDataContract() method of the class - when I look at the rdpDataContract value, it is simply a blank version of the contract.
My report loads the parameters of the contract when the report is run via my controller class, when I debug the contract, I can see the value change when I select it - when I click on OK to run the report with the parameters in place, the contract refreshes a number of times until the code reaches the processData method of the RDP class.
public void processReport() { SalesTable salesTable; MyTestContract orderContract; CreatedDateTime orderCreated; QueryBuildDataSource qbds; QueryBuildRange qbr; // process range values orderContract = this.parmDataContract() as MyTestContract; orderCreated = orderContract.parmCreatedDateTime();
It is here where it is almost as if a blank or new version of the contract is initialised and my selected values are not being returned.
I am sure there is something really minor wrong, somewhere but if someone could advise me on where to look that would be great.
Thanks
Hi,
Glad that my solution helps. If you want to be blank or multiple, I think that seems to be SSRS problem.
You might check this article and see if can applied. Also you can consider to make data in table converted to string "Null" so it can be an option as well.
Hi Alex
Sorry this is now working and I can see the extra parameters from my contract in the report. I did have to create a new design after I did this because the report didn't deploy.
I have a query about the new report parameters that get created.
If I have warehouse set as a parameter and I want to be able to add multiple values but I also want to be able to leave it blank what setup do I set on the report parameter?
Thanks
Hi Alex
The custom parameters from the contract are not present under the DATASETS - datasource table - Parameters area - the only ones present there are the default ones
Like I have said - when the code reaches the processReport method of the data provider class, the contract is empty.
The contract loads when the report controller is called and I am able to select the parameter value, however it is lost in passing between this point and the processReport method in RDP
If someone has experienced this issue before please let me know as it is extremely frustrating and I can't find where it is being lost in debugging.
Hi,
Can you check on the report to see if the CreatedDateTime parameter has been added to the report?
If not, please help to right click on the report dataset - restore so it can auto add the parameter for you. Then you can do build and deploy to report server, restart SQL reporting service to test further.
Thank you.
Hi Judy
Here is the code from the contract
////// Data Contract class for mytest report /// [DataContractAttribute] public class MyTestContract { str packedQuery; CreatedDateTime orderCreated; NoYesId dontProcess; InventLocationId warehouse; InventSiteId site; [DataMemberAttribute('CreatedDateTime'), SysOperationLabelAttribute(literalstr("Order Created DateTime")), SysOperationDisplayOrderAttribute('1')] public CreatedDateTime parmCreatedDateTime(CreatedDateTime _orderCreated = orderCreated) { orderCreated = _orderCreated; return orderCreated; } }
At this stage I am at a complete loss.
I know code similar to this works fine AX 2012 R3, but I built my contract class, my RDP class and my controller class all via the text book example.
Hi Kauto,
Suggest you go over and check your constract class if the 'DataContractAttribute' and 'DataMemberAttribute ' are mentioned at the beginning of the class.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,782 Super User 2024 Season 2
Martin Dráb 229,067 Most Valuable Professional
nmaenpaa 101,150