I have tried with a FlashBulder development, which communicates with the same PHP script to do as the existing components.
This is my first Flash project.
The creation of an MDC file works fine. Only the export of the same reports in a PDF file does not work.
Until onEnderComplete event handler everything works. Here is the code:
Code: Select all
private function onRenderComplete(event:Event):void
{
progressbar.label = "Complete...";
var buffer: ByteArray = new ByteArray();
report.removeEventListener(StiReportEvent.END_RENDER, onRenderComplete);
report.removeEventListener(StiReportEvent.BEGIN_RENDER, onRenderBegin);
documentstring = report.saveDocumentToString();
buffer = report.saveDocumentToByteArray();
switch (outputformat)
{
case "MDC": savedocumentstring(documentstring);
break;
case "PDF": safe_pdf(documentstring);
}
}
Code: Select all
private function savedocumentstring(buffer: String):void
{
// var request:URLRequest = new URLRequest(callbackurl);
callbackurl = "http://localhost/scriptcase/prod/third/reportengine/index.php";
callbackurl = callbackurl + "?stimulsoft_client_key=SaveReport&stimulsoft_report_key=" + documentfile;
var request:URLRequest = new URLRequest(callbackurl);
var loader:URLLoader = new URLLoader();
var parameters:URLVariables = new URLVariables();
parameters.stimulsoft_client_key = "SaveReport";
parameters.stimulsoft_report_key = documentfile;
parameters.data=buffer;
request.data =buffer;
request.method = URLRequestMethod.POST
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE,onSaveComplete);
loader.load(request);
}
Code: Select all
private function safe_pdf(doc: String):void
{
var pdfreport: StiReport = new StiReport();
var outbuffer: ByteArray = new ByteArray();
var service: StiPdfExportService = new StiPdfExportService();
// Create a new PDF export settings
var settings: StiPdfExportSettings = new StiPdfExportSettings();
// Create a buffer for report exporting
pdfreport.loadDocumentFromString(doc);
pdfreport.render(false);
pdfreport.
service.exportPdf(pdfreport,outbuffer,settings);
trace(outbuffer);
savebuffer(outbuffer);
}
Code: Select all
private function savebuffer(buffer: ByteArray):void
{
// var request:URLRequest = new URLRequest(callbackurl);
callbackurl = "http://localhost/scriptcase/prod/third/reportengine/index.php";
callbackurl = callbackurl + "?stimulsoft_client_key=SaveReport&stimulsoft_report_key=" + documentfile;
var request:URLRequest = new URLRequest(callbackurl);
var loader:URLLoader = new URLLoader();
var parameters:URLVariables = new URLVariables();
parameters.stimulsoft_client_key = "SaveReport";
parameters.stimulsoft_report_key = documentfile;
parameters.data=buffer;
request.data =buffer;
request.method = URLRequestMethod.POST
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(Event.COMPLETE,onSaveComplete);
loader.load(request);
}
Are there any plans that call
Code: Select all
index.php?stimulsoft_client_key=ExportFx&stimulsoft_report_key=report_key&stimulsoft_export_file =&stimulsoft_export_format=PDF
Since I have the PDF files on the server store, I wanted an alternative to PDF file with a. NET Application can be created on the server. Unfortunately, one can create with Application StiReport.NET not read the threads with DesignerFx templates because it is in. NET is not StiMySQLDatabase. Even an attempt to do everything via ODBC failed because the ViewerFX Create unfortunately ODBC database connection the report incorrect. All database fields are empty ....
Best Regards