Skip to main content

Notifications

Microsoft Dynamics AX forum
Unanswered

Get SSRS Report Parameter Value from Form Selected Grid

Posted on by Microsoft Employee

Hi Experts,

I am facing problem about getting values from form selected grid to SSRS report parameter dialog

Here is some Ref what i need

MyForm:

6371.form.png

In this above image i have selected one field name dhrumesh , I need that when i click on result menu button from above my selected field dhrumesh should come in the ssrs form parameter as below image

2161.report.png

But I am getting the other value . Below is my code of all the three classes i have developer

DP Class(Data Provider):

Process Report:

[SysEntryPointAttribute]
public void processReport()
{
Query query;
QueryRun queryRun;
QueryBuildDataSource queryDS;
QueryBuildRange queryRange;
KR_StudentDetail sdTable;
KR_StudentResultReportContract contract ;
ListIterator studentListIterator;

tempTable.clear();
contract = this.parmDataContract() as KR_StudentResultReportContract;
query = new Query(queryStr(KR_StudentResultView));
studentListIterator = new ListIterator(contract.parmStudentIDList());
queryDS = query.dataSourceTable(tableNum(KR_StudentDetail));

while(studentListIterator.more()){
queryRange = query.dataSourceNo(1).addRange(
fieldNum(KR_StudentDetail,ID));
queryRange.value(studentListIterator.value());
studentListIterator.next();
}
queryRun = new QueryRun(query);
while(queryRun.next()){
sdTable =queryRun.get(tableNum(KR_StudentDetail));
this.insertIntoTempTable(sdTable.ID,contract.parmSemester());
}
}

Controller PrePromptModify:

protected void prePromptModifyContract()
{

str test;
Query query;
KR_StudentDetail StudentDetail;
KR_StudentResultReportContract contract;
FormDataSource fds;
container con;
int i;
List list=new list(Types::String);
SrsReportHelper::addParameterValueRangeToQuery(this.getFirstQuery(),tableNum(KR_StudentDetail),fieldNum(KR_StudentDetail, Name),SysQuery::value(this.parmArgs().record().RecId));
contract = this.parmReportContract()
.parmRdpContract() as KR_StudentResultReportContract;
StudentDetail = Args.record();
fds = Args.record().dataSource();
contract.parmStudId(StudentDetail.Name);
if(this.parmArgs() && this.parmArgs().parm()){
contract = this.parmReportContract()
.parmRdpContract() as KR_StudentResultReportContract;
test = this.parmArgs().parm();
con = str2con(test,",");

contract.parmSemester(conPeek(con,1));
for(i=2;i<=conLen(con);i++){
list.addEnd(conPeek(con,i));
}
contract.parmStudentIDList(list);
}

//txt1 = this.parmArgs().record();
//contract = new KR_StudentResultReportContract();
//contract.parmStudId(txt1.ID);
//this.parmReportContract().parmRdpContract(contract);
}

Has anyone have solution for this?
I am using UIBuilder in the report.

I am very grateful if any of you can help my problem .

Thanks and Regards

Krutish Ruparelia

 

 

Categories:

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,186 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,996 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans