Page 1 of 1

change stimulsoft report .mrt file from C# program

Posted: Fri Jan 11, 2013 9:45 am
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.

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

Posted: Fri Jan 11, 2013 12:57 pm
by HighAley
Hello.

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

Thank you.

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

Posted: Mon Jan 14, 2013 4:41 am
by aihulya
Oh, you are right. Thanks a lot!

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

Posted: Mon Jan 14, 2013 5:57 am
by HighAley
Hello.

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

Thank you.