Page 1 of 1

Custom Save Options

Posted: Mon Sep 10, 2012 3:04 pm
by teisaacs
Hi, I'm currently looking at integrating the Reports.Fx into an application. I am using the Demo version at this time, we plan on purchasing the product today so this will change soon. I would like to know if it is possible to create a custom save dialog? My use case is to allow the user to design a report and have them save it to the server. I would like a custom save dialog that will allow them this option where I take over, prompt for a couple pieces of data and then send the report to the DB.

Thank you,
Todd

Re: Custom Save Options

Posted: Tue Sep 11, 2012 8:18 am
by HighAley
Hello, Todd.

You could handle a Save Event and show the custom save dialog.
Please, look at the 06_DesignerSaveEvent sample project which you could find in our distributive.

Thank you.

Re: Custom Save Options

Posted: Wed Sep 12, 2012 12:31 am
by teisaacs
Thanks for the information. I am trying to add an event listener to the designer in Actionscript but not having any luck. If I use the MXML tag like the example it works fine but I really want the dialog version to show.

Code: Select all

			private function onSaveReport(event:StiDesignerEvent) {
				trace("Save Report");
			}

			protected function openDesignerHandler(event:MouseEvent):void {

				var designer:StiDesignerFx = new StiDesignerFx();
				designer.initialize();

				var report:StiReport = new StiReport();
				designer.report = report;

				designer.addEventListener(StiDesignerEvent.SAVE_REPORT, onSaveReport);

				var database:StiMySqlDatabase = new StiMySqlDatabase("ssievents", "", "Server=localhost;Port=3306;Database=ssievents;Uid=ssievents;Pwd=testing;", false);
				report.dictionary.databases.clear();

				report.dictionary.databases.add(database);
				report.designDialog(null, "TEST");
			}

Re: Custom Save Options

Posted: Wed Sep 12, 2012 9:49 am
by Vladimir
Hello, Todd

Please try to use this code:

Code: Select all

         private function onSaveReport(event:StiDesignerEvent) {
            trace("Save Report");
         }

         protected function openDesignerHandler(event:MouseEvent):void {

            var report:StiReport = new StiReport();
 
            var database:StiMySqlDatabase = new StiMySqlDatabase("ssievents", "", "Server=localhost;Port=3306;Database=ssievents;Uid=ssievents;Pwd=testing;", false);
            report.dictionary.databases.clear();
            report.dictionary.databases.add(database);

            var designer:StiDesignerFx = report.designDialog(null, "TEST");
            designer.addEventListener(StiDesignerEvent.SAVE_REPORT, onSaveReport);
         }
Thank you.

Re: Custom Save Options

Posted: Thu Sep 13, 2012 12:03 pm
by teisaacs
Thank you!

This works well, I'm now hitting my callback method.

Re: Custom Save Options

Posted: Thu Sep 13, 2012 12:43 pm
by Vladimir
Hello, Todd

We always glad to help you!

Thank you.