on 04-22-2014 9:14 AM
Hello Experts,
I have created a UI5 Table based on Calculation View. Now I want to download this table to Excel.
I know that it can be done using XSJS
I have also checked Thomas Blog for downloading excel:
But my problem is how to pass input parameters to my XSJS file and in case any of the Input parameter is empty, how to handle that situation
Regards,
Rohit
You pass input parameters via URL parameters in XSJS generally. There are many examples of this in the online help and other various learning materials.
For input parameters that aren't passed as URL parameters I usually do something like the following check
tblName = $.request.parameters.get('tblName');
tblName = typeof tblName !== 'undefined' ? tblName : 'USERS';
That way if the parameter isn't passed then I default to a value USERS. If the parameter is passed but the value is blank it doesn't get caught by this logic.
In other cases I check to see if the value is null. I use this in cases where I also want to check for a blank value being passed:
var procedure_oid = $.request.parameters.get("procedure_oid");
if (procedure_oid == null) {
outputError('Invalid source procedure');
return;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
Thanks for you reply.
I was just trying EPM demo code to download Excel from UI.
The XSJS file is working fine.
But I am getting error on pressing Export button:
Uncaught TypeError: undefined is not a function
It is not accepting jQuery.download function
Do I have to install any additional jQuery plugin for this?
Regards,
Rohit
Yes this is an extra function defined in the code. Look in global.js of that project for the implementation of the download function. It is an open source example from: jQuery Plugin for Requesting Ajax-like File Downloads | Filament Group, Inc., Boston, MA
Hi Rohit,
I also come across the problem : Uncaught TypeError: undefined is not a function
So how do you fix this problem ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.