Download CSV file to another folder instead of ExportPath
We have a requirement to create CSV file and save that file to destination folder. We have this code but seems not working Code Snippet:
FileName+=fileNameParam; if(appendTimeStamp){ FileName+="_"; FileName+=dtu.getCurrentTimeStamp(); } FileName+=".csv"; String strSQLfullPath = exportPath+ sep + FileName; PRFile f = new PRFile(strSQLfullPath); try{ // Create file PROutputStream stream = new PROutputStream(f); PRWriter out = new PRWriter(stream, null, false); // Bug with Excel reading a file starting with 'ID' as SYLK file. If CSV starts with ID, prepend an empty space. if(CSVString.startsWith("ID")){ CSVString=" "+CSVString; } out.write(CSVString); //Close the output stream out.close();
Anyone have same scenario? please share solutions. thanks