Page 1 of 1

WPF viewercontrol - custom filename in savedialog

Posted: Wed Mar 30, 2011 4:32 am
by Lieve
Hi,

I would like to insert a custom file name when I open the save file dialog from the WPF stimulsoft viewercontrol.
Is there any way I could do this?


WPF viewercontrol - custom filename in savedialog

Posted: Wed Mar 30, 2011 6:43 am
by Alex K.
Hello,

This file name in the save dialog is taken from the ReportName. After downloading the report, you can set the required report name for saving.

Code: Select all

StiReport report = new StiReport();
report.Load();
report.ReportName = "YourNameForSave";
report.Render();
stiViewerControl1.Report = report;
Thank you.

WPF viewercontrol - custom filename in savedialog

Posted: Wed Mar 30, 2011 6:50 am
by Lieve
Thank you
My problem has solved.

I've set the ReportName property after the Report.Render() and than it doesn't work.

WPF viewercontrol - custom filename in savedialog

Posted: Wed Mar 30, 2011 6:55 am
by Alex K.
Hello,

Ok.
Let us know if you need any additional help.

Thank you.

WPF viewercontrol - custom filename in savedialog

Posted: Thu Mar 31, 2011 4:19 am
by Lieve
Hello,

The file name in the save dialog is not always taken from the ReportName.
Can some property on the report desinger (mrt) override this ReportName?

Thank you.

WPF viewercontrol - custom filename in savedialog

Posted: Thu Mar 31, 2011 7:34 am
by Alex K.
Hello,

Can you please describe your task in details?

Thank you.

WPF viewercontrol - custom filename in savedialog

Posted: Thu Mar 31, 2011 8:53 am
by Lieve
Hello,

My problem has solved.
If the report alias name is set in the report template, then my code takes the alias name from the template and not the reportfilename from my code.
If I set also the report alias name in my code, then I can always set the report name in the save dialog.


WPF viewercontrol - custom filename in savedialog

Posted: Fri Apr 01, 2011 5:15 am
by Andrew
Great!

Have a nice day!