change stimulsoft report .mrt file from C# program

Stimulsoft Reports.WPF discussion
Post Reply
aihulya
Posts: 3
Joined: Fri Jan 11, 2013 9:21 am

change stimulsoft report .mrt file from C# program

Post by aihulya »

Hello!
How can I change stimulsoft report .mrt file from C# program? I want to change connection string in all my .mrt files. This is my code:

string path = "C:\\Users\\";
try{
DirectoryInfo dir = new DirectoryInfo(path);
foreach (FileInfo file in dir.GetFiles())
{
StiReport report = new StiReport();
report.Load(file.Name);
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("EiszConn", "EiszConn", "NewConnectionString", false));
}

But it doesn't work. Connection strings are still the same.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: change stimulsoft report .mrt file from C# program

Post by HighAley »

Hello.

You don't save the report templates. Add the report.Save() method.

Thank you.
aihulya
Posts: 3
Joined: Fri Jan 11, 2013 9:21 am

Re: change stimulsoft report .mrt file from C# program

Post by aihulya »

Oh, you are right. Thanks a lot!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: change stimulsoft report .mrt file from C# program

Post by HighAley »

Hello.

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

Thank you.
Post Reply