Page 1 of 1

How to allow user input report name in OnSaveReport Method?

Posted: Thu Aug 30, 2012 10:05 pm
by lucas_histree
Hi there,

We currently using OnSaveReport to save report on server, and we are just wondering is it possible to show a customized input box before the report is saved on the server to be able to customize the file name, something like [please enter a report name:__________ (ok)(cancel)]. Below is what we have in the OnSaveReport so far:

protected void StiWebDesigner1_SaveReport(object sender, StiWebDesigner.StiSaveReportEventArgs e)
{
StiReport report = e.Report;
string path = @"..\ReportHolder\" + Session["client_id"].ToString();
//Customize report name here

//------------------------------------

e.ErrorCode = 0;
//make directory according to the client id
if (!Directory.Exists(path)) { Directory.CreateDirectory(path); }
//save report
if (!File.Exists(path + @"\" + report.ReportName + ".mrt"))
{
File.WriteAllText(path + @"\" + report.ReportName + ".mrt", "test");
}

else
{
report.Save(Server.MapPath(path + @"\" + report.ReportName + ".mrt"));

}
}


Any direction will be much appreciated! :)

Thanks,
Lucas

Re: How to allow user input report name in OnSaveReport Meth

Posted: Fri Aug 31, 2012 7:34 am
by HighAley
Hello, Lucas

We have prepared two examples for you that implement a simple display of the file input dialog.

Thank you.

Re: How to allow user input report name in OnSaveReport Meth

Posted: Fri Aug 31, 2012 4:59 pm
by lucas_histree
Thanks alot for the excellent support! Thumb up!

Re: How to allow user input report name in OnSaveReport Meth

Posted: Mon Sep 03, 2012 6:06 am
by HighAley
Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.