I am trying to write a text (html) file to the desktop of the client which will be opened by Excel as a way of exporting data to excel where the user can choose some more understandable field names, and also so that I can get image blobs out and into excel. I will loop through the foundset to populate my html.
My method ends with this:
v_raw_html += "</table></body></html>"
var f = plugins.file.convertToJSFile(v_raw_html);
var path = plugins.file.getHomeDirectory()
path = path.getAbsolutePath();
var v_date_today = utils.dateFormat(new Date,'ddMMyy')
var export_to_file = path + '/Desktop/' + v_date_today + 'export.htm'
if (!f.exists()){
plugins.file.writeFile(export_to_file,f)
}
There is more to v_raw_html before this, but that all works
Problem is I get this error when I try to run it:
Can’t find method com.servoy.extensions.plugins.file.FileProvider.js_writeFile(org.mozilla.javascript.CharSequenceBuffer,com.servoy.extensions.plugins.file.JSFile). (/Applications/Servoy/servoy_workspace/art/forms/export_dialog.js#206)
Can’t find method com.servoy.extensions.plugins.file.FileProvider.js_writeFile(org.mozilla.javascript.CharSequenceBuffer,com.servoy.extensions.plugins.file.JSFile). (/Applications/Servoy/servoy_workspace/art/forms/export_dialog.js#206)
at /Applications/Servoy/servoy_workspace/art/forms/export_dialog.js:206 (export_to_html_and_close)
at /Applications/Servoy/servoy_workspace/art/forms/artwork.js:663 (show_export_dialog)
I have no idea what I’m doing wrong… Please help…
Thanks
Bevil