Skip to Content
0
Former Member
Mar 03, 2009 at 11:27 PM

Change command at run time

31 Views

We have a .NET Crystal application (Crystal 2008, VS 2003) that interacts with a propetarian OLEDB provider.

At run time I need to modify the command that is passed to the OLEDB. I do not need to change the SQL, but pass parameters information for the OLEDB.

I get the command text:

CrystalDecisions.ReportAppServer.DataDefModel.ISCRTable Tbl;
CrystalDecisions.ReportAppServer.DataDefModel.CommandTable cmdTbl;

//crReportDocument is the ReportDocument
Tbl = crReportDocument.ReportClientDocument.DatabaseController.Database.Tables[0];

cmdTbl = Tbl.Clone(true) as CrystalDecisions.ReportAppServer.DataDefModel.CommandTable;

//what I need to do is to change this command to
newCmdTbl = cmdTbl.CommandText.ToString() + "flags"

How I assign this newCmdTble back to the ReportDocument?

Thanks