PDA

View Full Version : Function to open XLS file from within Program


ThierryC
12-08-2009, 12:12 PM
hi,

in the standard valence there's the api to open Ifs -files,
however i do not succeed in opening a standard xls-file.
When using the vvout_file. api with the xls, my browser crashes
i wrote a small pgm to test the vvout, by entering the path and the filename...
should this work with XLS-files?
i saw in the documentation only HTML/PDF/CSV.. but no xls...
or should an ifs file be opened in another way.

vvSessId = vvIn_char('sid');
action = vvIn_char('action'); // retrieve the value of action
If (action='OpenFile');
InFileName = vvIn_char('Filename');
InPath = vvIn_char('Path');
vvOut.download= 'Y';
vvOut.file =%trim(InFileName);
vvOut_file(%trim(InPath)+%trim(InfileName):vvOut);

Endif;
*inlr=TRUE;


is this the right way to open an xls-file...
in the examples-menu , i've found your example that can directly open an excel file from within Valence-portal menu...
but i'd like to have to same possibility from within a program...
is this possible?

sean.lanktree
12-08-2009, 12:28 PM
What is the name of file that you are trying to open? Specifically, the file suffix? Are you sure that the path exists? Any clue in firebug, under the net tab? Are you getting any sort of permission denied?

ThierryC
12-08-2009, 12:47 PM
Hi Sean,

you've opened my eyes.... i saw in the response the content of the xls.file..

i was using a Ajax request rather than... see code... now it works ...
thx a lot.


var callRPG = function() {
Ext.DomHelper.append(document.body, {
tag: 'iframe',
frameBorder: 0,
width: 0,
height: 0,
css: 'display:none;visibility:hidden;height:1px;',
src: 'vvcall.pgm?sid='+sid+'&opt='+opt+'&pgm=CM_COGP63R&action=OpenFile&Filename=' + Ext.get('Filename').getValue()+'&Path='+Ext.get('Path').getValue()
});
};