fiogf49gjkf0d Dear All,
I just need help regarding following scenario.
I am using SLX 7.5.4 Web. I need to call a report on web on a button click of account detail screen by dynamically passing account id as a parameter.
The Report is “Custom Account Detail Report” which aspects one parameter which is accountid
In Architect report settings are main table is Account table and Masteruserid is accountid
Externally my report works fine when I manually pass any accountid as parameter.
I am using below JS function for calling report.
function ShowReportByName(ReportName) { if (GLOBAL_REPORTING_URL == "") { alert(MSGID_THE_REPORTING_SERVER_HAS_NOT_BEEN); return; } if (ReportName == null || ReportName == "") { alert(MSGID_THE_REPORTNAME_HAS_NOT_BEEN_DEFINED); return; } if (Sage.Services.hasService("ClientEntityContext")) { var contextSvc = Sage.Services.getService("ClientEntityContext"); var context = contextSvc.getContext(); var strTableName = context.EntityTableName.toUpperCase(); var strEntityId = context.EntityId; if (strEntityId != "") { var strReportId = GetReportId(ReportName); if (strReportId != null && strReportId != "") { PopulateGlobals(strReportId, strTableName, strEntityId); var url = "ShowReport.aspx"; window.open(url, "ShowReportViewer", "location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,width=800,height=630"); } else { alert(MSGID_THE_REPORT_COULD_NOT_BE_LOCATED_FOR) } } else { alert(MSGID_THE_CURRENT_ENTITY_IS_UNDEFINED); } } else { alert(MSGID_UNABLE_TO_SHOW_THE_DETAIL_REPORT); } }
I am giving the report name as parameter at client click. But still it is asking for the parameter.
Could you please help me with this..
I have also tried below JS function which is in reportutil.js of slxlclient portal file but it is not working it is still asking for parameter to pass manually.
function ShowReport(ReportNameOrId, EntityTableName, EntityId) { if (GLOBAL_REPORTING_URL == "") { alert(MSGID_THE_REPORTING_SERVER_HAS_NOT_BEEN); return; } if (ReportNameOrId == null || ReportNameOrId == "") { alert(MSGID_THE_REPORTNAMEORID_IS_UNDEFINED_IN); return; } if (EntityTableName == null || EntityTableName == "") { alert(MSGID_THE_ENTITYTABLENAME_IS_UNDEFINED_IN); return; } if (EntityId == null || EntityId == "") { alert(MSGID_THE_ENTITYID_IS_UNDEFINED_IN); return; } var strReportId = GetReportId(ReportNameOrId); if (strReportId != null && strReportId != "") { var strTableName = EntityTableName.toUpperCase(); var strEntityId = EntityId; if (strEntityId != "") { PopulateGlobals(strReportId, strTableName, strEntityId); var url = "ShowReport.aspx"; window.open(url, "ShowReportViewer", "location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,width=800,height=630"); } else { alert(MSGID_THE_CURRENT_ENTITY_IS_UNDEFINED); } } else { alert(MSGID_THE_REPORT_COULD_NOT_BE_LOCATED_FOR) } }
Thanks in advance |