Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: ReportDocument.SaveAs() Post Reply Post New Topic
Author Message
AlexC
Newbie
Newbie
Avatar

Joined: 01 Jul 2009
Online Status: Offline
Posts: 1
Quote AlexC Replybullet Topic: ReportDocument.SaveAs()
    Posted: 01 Jul 2009 at 4:20am
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 ?
AlexC
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.