Which IIQ version are you inquiring about?
- 8.3
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
String formattedDate = dateFormat.format(new Date());
String fileName = "/examplepath/report" + formattedDate + ".csv";
File file = new File(fileName);
TaskManager taskManager = new TaskManager(context);
TaskResult taskResult = taskManager.runSync("Test Report", new HashMap());
if (taskResult != null) {
JasperResult jasperResult = taskResult.getReport();
if (jasperResult != null) {
JasperRenderer renderer = new JasperRenderer(jasperResult);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
renderer.renderToCSV(baos, "csv");
FileOutputStream fos = new FileOutputStream(file);
baos.writeTo(fos);
fos.close();
baos.close();
}
}
Share all details about your problem, including any error messages you may have received.
I’m having an issue where certain columns are getting truncated and split across multiple rows. I have a rule that runs and saves off a search report csv to be consumed by another business process. Whenever I do the identity search, the result and csv that can be exported in the UI are as I expect. However, whenever I save the search as report and execute it through the UI or the rule, I get a different output than I expect. Is this just user error on my end when it comes to saving the search as report? The code I’ve attached is what’s being executed by the rule. Additionally I’ve tried using
File file = renderer.renderToCSVFile(fileName);
But I assume the issue is how the report is getting generated in the first place.