I have created a report using RDP class. I want to open it from the form LedgerJournalTable by selecting one line from grid and clicking the menu item. I have also written the controller class to achieve this, but when I click on the menu item, it gives the error that the value "" is not in the map.
After debugging, I found that this line this.setRanges(this.parmReportContract().parmQueryContracts().lookup(this.getFirstQueryContractKey())); in the function protected void prePromptModifyContract() gives the error. Please help. I have not created query and I don't want to use it.
*This post is locked for comments
Hey bro i have also same issue how you resolve this then tell me.
Oh! If I found something better, I will share.
Thankyou so much :)
D365 have a lot of issues indeed, but SSRS engine and classes are being intact from AX2012 version, and should work as expected. That is why I am sceptic about your solution
I have tried every method but unfortunately AX 365 have many issues yet. So, I created my own logic. :)
Your links are very much knowledgable. I already tried many of these solutions.
Sharing my logic to make it working is just to solve the problem if anyone having. I know this is not the best solution technically, but it is best if developers are having problems.
Thanks for your help.
Well technically that trick with TMP table should work, but that is not a good idea to use it:
1. TNP tables are not fast, and to create a new instance just to pass data between DP and Controller is not ideal
2. If packed incorrectly, you parameters might be missed if SSRS is run in Batch
Something is definitely wrong if DataContract is not working.
I would suggest you to check this example of DP base SSRS, but skipp everything related to queries
technet.microsoft.com/.../gg724119.aspx
And here you can check valid way to use preRunModifyContract method to populate your values
Hope this can help you.
I am not passing the whole table. I am inserting data into temp table in Controller class and when RDP class is called, it will get the data from temporary table.
Contract Class was also not working. So, I worked around like this.
How exactly are you going to pass temporary table from controller class to DP class? You will need to pack data somehow inside of DataContract class to pass it to DP, so maybe it is easier to get specific values and pack them instead of storing data inside of TMP table? You can add additional fields and parm methods to your DataContract class, set them as "Invisible" or set "ShowOnDialog" to false, and then use them in your DP. Creating a new instance of TMP table seems to be an overkill.
I am not using query that is why the setRanges could not be called. Moreover, my controller is called when Action Menu Item is clicked. So, I found a way around.
Follow these steps to pass data between controller and RDP classes:
If you found my answer good, mark it as verified.
Moeen,
I don't see the call of this line in your prePromptModifyContract() method:
this.setRanges(this.parmReportContract().parmQueryContracts().lookup(this.getFirstQueryContractKey()));
And also there is no super() that might be the reason for this, so I don't see the reason for this line to be called.
Are you sure that your menu item calls you controller?
Also, there is a missing } closing bracket but I think that this is typo
When menu item is clicked, I want to send the argument(i.e. selected row) from controller class to the processReport() function of RDP class.
Contract class:
[DataContractAttribute]
public class MCS_PaymentVoucherContract
{
str id;
[DataMemberAttribute("id")]
public str parmId(str _id = id)
{
id = _id;
return id;
}
}
Controller class:
public class MCS_PaymentVoucherController extends SrsReportRunController
{
protected void prePromptModifyContract()
{
LedgerJournalTable dataTable;
MCS_PaymentVoucherContract contract;
if (this.parmArgs() && this.parmArgs().record())
{
contract = this.parmReportContract().parmRdpContract() as MCS_PaymentVoucherContract;
dataTable = this.parmArgs().record();
contract.parmId(dataTable.JournalNum);
// info(strFmt("%1",dataTable.JournalNum));
}
public static void main(Args _args)
{
MCS_PaymentVoucherController controller = new MCS_PaymentVoucherController();
controller.parmReportName(ssrsReportStr(MCS_PaymentVoucherReport,PaymentVoucherReportDesign));
controller.parmArgs(_args);
controller.parmShowDialog(false);
controller.startOperation();
}
}
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... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156