Forum

This content is now out of date.

Visit Our Community

Publish BIRT reports via the web service API

Can we publish BIRT reports via the web service API or some other mechanism? The idea here is to have the reports show up directly in the report list without having to actually recreate them in the web UI.
Yes you can publish a BIRT report to Yellowfin via webservices.


Code: Select all
AdministrationServiceClient asm = null;

/////// Create connection to Yellowfin Webservices....

try {

asm= new AdministrationServiceClient(host, port, user, password, service);

} catch (Exception e) {
e.printStackTrace();
}

AdministrationReport report = new AdministrationReport();

report.setExecutionObject("birtReport1");
report.setReportName("birt report 1");
report.setReportDescription("birt report description");
report.setSourceId(new Integer(20040));
report.setExecutionObject("wsbirt1");
report.setReportCategory("TUTORIAL");
report.setReportSubCategory("CLIENT");

try {

File f = new File("new_report_3.rptdesign");
FileInputStream r = new FileInputStream(f);
byte[] data = new byte[(int) f.length()];

r.read(data);

report.setBirtData(data);

} catch (Exception e) {

System.out.println("Error opengin file");

}


boolean success = asm.addBirtReport(report);

System.out.println("Upload BIRT Success: " + success);