It is possible to programmatically export a document to Flash using the Strategy Web SDK 9.4.1.
To do this follow the code sample below:
package com.Strategy.sdk.standalone;
import java.io.FileOutputStream;
import com.Strategy.web.beans.RWBean;
import com.Strategy.web.beans.WebBeanFactory;
import com.Strategy.web.objects.rw.EnumRWExecutionModes;
public class ExportReportFlashStandalone {
private static final String DOC_ID = "";
private static final String FILE_OUTPUT = "";
public static void main(String[] args) {
RWBean rwb;
FileOutputStream fos;
try {
// create the RWBean for the document object
WebBeanFactory factory = WebBeanFactory.getInstance();
rwb = (RWBean) factory.newBean("RWBean");
rwb.setSessionInfo(/* WebIServerSession object */);
rwb.setObjectID(DOC_ID);
rwb.getRWInstance().setAsync(false);
rwb.collectData();
// set the execution mode to Flash export
rwb.setExecutionMode(EnumRWExecutionModes.RW_MODE_FLASH_EXPORT);
// get the binary data for the MHT file
byte[] data = rwb.getRWInstance().getExportData();
// output to a MHT file using an output stream
fos = new FileOutputStream(FILE_OUTPUT);
fos.write(data);
fos.flush();
fos.close();
}
catch (Exception ex) {
ex.printStackTrace();
}
finally {
fos = null;
// close the session
}
}
}