Skip to Content
Jul 19, 2019 at 09:58 AM

Modify the source table runtime in crystal report


Hi, i need to modify at runtime, programmatically, the qualifiedname of the tables of a report.

Use this code

var doc = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); doc.Load(file); foreach (dynamic table in (((CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper)doc.ReportClientDocument).Database).Tables) { table.QualifiedName = $"{DB}.{mCurrSchema}.{table.Name}"; } doc.SaveAs(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(file),System.IO.Path.GetFileNameWithoutExtension(file) + "_new.rpt")) ; doc.Close();

but the qualified name is not saved, i i reload the report the qualifedname is the oldest. Someone has had my same need or problem.

Thanks in advance

Raffaele Zurlo