Page 2 of 2

Re: Common Data connection

Posted: Fri Oct 05, 2018 6:32 am
by Lech Kulikowski
Hello,

Thank you for the sample code.

Re: Common Data connection

Posted: Thu Mar 14, 2019 5:22 pm
by ianwelsh
We loop over all the data connections in case the report has more than one source.

And instead of clearing we just overwrite. Not sure if one or other is better practice...would be good to know though.

Something like this:

public void StiWebViewer1_GetReport(object sender, StiReportDataEventArgs e)
{
StiReport report = new StiReport();
report.Load(Server.MapPath("App_Data/Report.mrt"));

foreach (StiSqlDatabase db in report.Dictionary.Databases)
db.ConnectionString = YourConnectionString;
report.Compile();
StiWebViewer1.Report = report;
}

Re: Common Data connection

Posted: Fri Mar 15, 2019 11:12 am
by HighAley
Hello,

Your code changes the connection string.
Another sample allows for changing the type of connection.

Thank you.