ExportFx

Stimulsoft Reports.PHP discussion
Post Reply
chopper64
Posts: 26
Joined: Mon Dec 20, 2010 2:33 am
Location: Berlin

ExportFx

Post by chopper64 »

I am developing a documentation system at the time with PHP. I would like to use as a reporting tool StiReports. So far, the implementation went well and the components DesignerFx ViewerFX quite well. Now I still need a component that automatically does the export to PDF or other file formats.
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 
will be possible?

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
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

ExportFx

Post by Vladimir »

Hello,

1. Yes, we plan to implement in Reports.Fx for PHP the ability to save the exported report on the server side (something like this, as you indicated).
2. For Stimulsoft Reports.Net works correctly with MySQL, please download and install the MySQL data adapter, which is available on our website download page: http://stimulsoft.com/Downloads.aspx

Thank you.
chopper64
Posts: 26
Joined: Mon Dec 20, 2010 2:33 am
Location: Berlin

ExportFx

Post by chopper64 »

Thank you for the information concerning ReportsFxPHP. I then wait until the functionality is implemented. I hope it will very soon be the case ..

In the intermediate time, I tried following the instructions reports.NEt to connect to MySQL.
First, I VisualWebDeveloper In 2010, the project is loaded for the DLL and ConectorNet Stimulsoft.Report.MySqlDatabse created.
I have loaded my project for a console application by reference.
Unfortunately I get when running report.rende (false) in Visual Basic 2010, the following error message:
Referenced assambly 'System.Data.dll "not found

What to do?

Thank you
Post Reply