Fail to customize buttons for Exporting to Excel and PDF
The requirement is to export all the records when clicked on Export to Excel or PDF in list view and summary view with paging enabled. But due to paging, the default behavior fetches only the current page records.
User tried to customize buttons using HTML fragment. Direct list views work fine with it, however, for summary view, unable to pass the drilldown parameter.
Steps to Reproduce
1. Create HTML fragment with the function to call activity (activity which is based on the parameter passed will call two different functions , one for activity to download excel for all records, another based on parameter value)
2. Use the HTML in custom script and provide the function name in export excel button.
A software use or operation error.
Perform the following local-change:
1. Use the below code in HTML fragment to get the OpID parameter value and store it in hidden input element.
String OpID = tools.getParamValue("OpID");
tools.appendString("<input type=hidden id=paramID value=\""+ OpID +"\">");
2. Get the hidden input element value on click of "Export to Excel" button and pass that value to the export activity.
var OpID = document.getElementById("paramID").value;
var windowProps = 'toolbar=no,location=no,menubar=no,status=yes,scrollbars=yes,resizable=yes,width=750,height=600';
var URL = new SafeURL("ClassName.ActivityName"); //Replace ClassName with name of the Applies To class and ActivityName with name of your export activity
url = URL.toURL();
Please refer the below PDN forum links for more information.
4. Use Param.OpID in the activity and listview to get the parameter.
0% found this useful