How to allow user input report name in OnSaveReport Method?

Stimulsoft Reports.WEB discussion
Post Reply
lucas_histree
Posts: 2
Joined: Thu Aug 30, 2012 9:55 pm

How to allow user input report name in OnSaveReport Method?

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

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

Post by HighAley »

Hello, Lucas

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

Thank you.
Attachments
Examples.rar
(13.37 KiB) Downloaded 191 times
lucas_histree
Posts: 2
Joined: Thu Aug 30, 2012 9:55 pm

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

Post by lucas_histree »

Thanks alot for the excellent support! Thumb up!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post by HighAley »

Hello.

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

Thank you.
Post Reply