Custom Save Options

Stimulsoft Reports.Flex discussion
Locked
teisaacs
Posts: 5
Joined: Mon Sep 10, 2012 2:46 pm

Custom Save Options

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Custom Save Options

Post 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.
teisaacs
Posts: 5
Joined: Mon Sep 10, 2012 2:46 pm

Re: Custom Save Options

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

Re: Custom Save Options

Post 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.
teisaacs
Posts: 5
Joined: Mon Sep 10, 2012 2:46 pm

Re: Custom Save Options

Post by teisaacs »

Thank you!

This works well, I'm now hitting my callback method.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Custom Save Options

Post by Vladimir »

Hello, Todd

We always glad to help you!

Thank you.
Locked