Page 1 of 1

Saving Templates and Reports

Posted: Thu Mar 24, 2011 11:32 am
by chopper64
How can you save in DesignerFx the amended report?
I call the Desinger so on

Code: Select all

http://localhost/sds/reportengine/index.php?stimulsoft_client_key=DesignerFx&stimulsoft_report_key=C:/data/sds/dokumente/template/UGS_TM_CAVERN_LEACHING/UGS_TM_CAVERN_LEACHING.mrt
So I'm the designer with a given file. But the call-back Save_Report "which then calls sti_save_report ($ report) brings, but although the amended report with the name of the file from which you loaded the report added, is gone.
Also, the store in session variables is useless, because the callback seems to no longer point of the session ....
This should be at the server-side solution for storing the templates are changed something ....

What should you do?
First, they passed with session_id on index.php:

Code: Select all

http://localhost/sds/reportengine/index.php?session=7700c67b58d8776555dad00f080384b9&stimulsoft_client_key =...
The following lines in the original index.php eränzen:

Code: Select all

$ session = sti_get_parameter_value ("session");

session_id ($ session);
session_start ();
$ client_key sti_get_parameter_value = ("stimulsoft_client_key");
$ report_key sti_get_parameter_value = ("stimulsoft_report_key");
Then the values ​​in session variables store. But watch out! Only when the values ​​were also passed! Otherwise they are overwritten. DesignerFX.swf index.php calls again and again, for example. to load the language or data, etc..

Code: Select all

if (!empty($report_key)) $_SESSION['sds']['reportengine']['report_key'] = $report_key;  # Name reporttemplatefile
if (!empty($client_key)) $_SESSION['sds']['reportengine']['client_key'] = $client_Key;  # call mode
Now you can access the session variables:

Code: Select all

function sti_save_report ($ report)
{
  $ result = "-1";
  $report_key = $ _SESSION['report_key'];
  If (empty ($report_key))
    {  
       $result = "0";
       # Now save the changes in server-side file .....
    }
  else
   {
     $result = "File not Found";
   }
return $result;
}

Saving Templates and Reports

Posted: Sat Mar 26, 2011 3:06 pm
by Vladimir
Hello,

Thanks for the idea with the sessions. Also, we will modify the save report function, in the parameters will be passed a report key and the new report flag.

Thank you.

Saving Templates and Reports

Posted: Mon Mar 28, 2011 4:52 am
by Vladimir
Hello,

We have improved the method of saving the report, now it takes the following parameters:

Code: Select all

function sti_save_report($report, $report_key, $new_report_flag)
Update will be available in the release of version 2011.1 on the week.

Thank you.

Saving Templates and Reports

Posted: Tue Mar 29, 2011 2:48 am
by chopper64
Booyah!
If you're at it change the functional sti_save_report something, then it would be good if the return value would allow more than 0, -1 or a text.
Maybe:
0: No message
-1 : gives error: from
1, : only message from

it would be possible to output error messages and confirmation messages

Saving Templates and Reports

Posted: Tue Mar 29, 2011 7:08 am
by Vladimir
Hello,

We have also improved the message box of the saving result. Now it works as follows:
-1: the message box is not shown
0: shows the "Report is successfully saved" message (localized)
other number: shows "Error at saving. Error code: {number}" message (localized)
text: show message with specified text

Thank you.