Hi Vijay,
Good Morning!
For a moment suppose we will think we have an option set which has 5 different values and we have 5 ssrs reports for each option set value we have to run different different report, in this scenario we will use Ribbon button, the option set value which we have choosen in product for that record only the specific report will open ,
Write a java script for the ribbon button
function functionname()
{
var entityGuid = Xrm.Page.data.entity.getId();
var entityType = "1088"; //Replace
var Optionsetvalue=get the option set value here ;
write --switch case for that
switch(Optionsetvalue)
{
case 1: //report for option set value 1
var rdlName = "Order.rdl"; //Replace
var reportGuid = "8500df62-a624-e411-8882-6c3be5a8ea94"; //Replace
var entityGuid = Xrm.Page.data.entity.getId();
var url = Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=" + rdlName + "&id={" + reportGuid + "}&records=" + entityGuid + "&recordstype=" + entityType;
window.open(url, null, 800, 600, true, false, null);
break;
case 2: //report for option set value 2
var entityGuid = Xrm.Page.data.entity.getId();
var url = Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=" + rdlName + "&id={" + reportGuid + "}&records=" + entityGuid + "&recordstype=" + entityType;
window.open(url, null, 800, 600, true, false, null);
break;
case 3: //report for option set value 3
var entityGuid = Xrm.Page.data.entity.getId();
var url = Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=" + rdlName + "&id={" + reportGuid + "}&records=" + entityGuid + "&recordstype=" + entityType;
window.open(url, null, 800, 600, true, false, null);
break;
}
}
please go through this link for the refrence
community.dynamics.com/.../running-a-report-from-a-ribbon-button
Regards,
Krishna