Hi,
I'm a bit in a jam. We want to change from Paradox 7 (don't ask) to SQL Server. Which is easy enough. Problem is there are more than 400 reports (with who knows how many subreports in them) which the datasource needs to change. So I decided to plunge in the deep end and managed to change them with code similiar to :
ReportDocument
doc = new ReportDocument();
try
{
doc.Load(stReport);
lResult = ProcessReportTables(doc);
if (ReportHasChanged)
{
string NewReport = NewReportName(stReport);
doc.SaveAs(NewReport);
}
}
to process the report, I find all the tables in the report and for each table do :
private bool DoReportTable(CrystalDecisions.CrystalReports.Engine.Table table)
{
table.LogOnInfo.ConnectionInfo.DatabaseName = ... ; table.LogOnInfo.ConnectionInfo.ServerName = ... ;
}
The doc.SaveAs(NewReport) gets executed and the 'new' .rpt file is there, but the report still refers to the old Paradox 7 tables.
Any ideas what I'm doing wrong ?