WPF viewercontrol - custom filename in savedialog

Stimulsoft Reports.WPF discussion
Post Reply
Lieve
Posts: 4
Joined: Wed Mar 30, 2011 4:27 am

WPF viewercontrol - custom filename in savedialog

Post 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?

Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

WPF viewercontrol - custom filename in savedialog

Post 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.
Lieve
Posts: 4
Joined: Wed Mar 30, 2011 4:27 am

WPF viewercontrol - custom filename in savedialog

Post by Lieve »

Thank you
My problem has solved.

I've set the ReportName property after the Report.Render() and than it doesn't work.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

WPF viewercontrol - custom filename in savedialog

Post by Alex K. »

Hello,

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

Thank you.
Lieve
Posts: 4
Joined: Wed Mar 30, 2011 4:27 am

WPF viewercontrol - custom filename in savedialog

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

WPF viewercontrol - custom filename in savedialog

Post by Alex K. »

Hello,

Can you please describe your task in details?

Thank you.
Lieve
Posts: 4
Joined: Wed Mar 30, 2011 4:27 am

WPF viewercontrol - custom filename in savedialog

Post 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.

Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

WPF viewercontrol - custom filename in savedialog

Post by Andrew »

Great!

Have a nice day!
Post Reply