Unable to save a report in CSV format in web client

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Unable to save a report in CSV format in web client

Postby hareendra » Fri Jan 15, 2010 9:28 am

Hi,

There seems to be an issue when saving a report of type csv when running on web client.
I initially save the report on the server machine as follows,

plugins.jasperPluginRMI.jasperReport(database_name,report_template,_localSavePath,_saveAsType,_params);

image1.jpg
image1.jpg (6.44 KiB) Viewed 1816 times


then i dowload it using,

application.showURL(_serverURL+_filename+"."+_saveAsType,"_self");

The issue is When I try to save as csv (_saveAsType = 'csv'), instead of getting the popup to save the file , it opens in a browser window displaying the report in csv. The browser window gets filled with csv context.

image2.jpg
image2.jpg (33.08 KiB) Viewed 1816 times


This only happens for csv types. For other types such as xls, the file gets downloaded properly

Can anyone help me out? Thanks in advance

Regards,
Hareendra
hareendra
 
Posts: 98
Joined: Wed Sep 17, 2008 11:41 am

Re: Unable to save a report in CSV format in web client

Postby jcompagner » Thu Jan 21, 2010 1:39 pm

i guess the browser sees it as a normal text file and just opens it in the browser.

in servoy 5.1 you can do plugins.file.writeTXTFile(file,text_data) that should open up a file save dialog.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Web Development

Who is online

Users browsing this forum: No registered users and 5 guests