Hey all,
I've CR9/C# application that calls the ReportDocument.SetDataSource method, passing it a DataTable populated earlier.
The report, if run on its own, requires four variables. The report Stored Proc gets called earlier through code, hence my using SetDataSource to pass-in the data.
My problem is that I use a couple of the report parameters in the report's design (DateFrom, DateTo, etc.). When I change the DataSource it clears out the ParameterFields array. So I'm looking for an easy way to store and re-create the parameters. I've tried the following which does store the variables in a ParameterFields object:
CrystalDecisions.Shared.ParameterFields crParams = new CrystalDecisions.Shared.ParameterFields(rptTest.DataDefinition.ParameterFields);
However executing the following later doesn't work:
rptTest.DataDefinition.ParameterFields = crParams;
(error message="Cannot implicitly convert type 'CrystalDecisions.Shared.ParameterFields' to 'CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions'")
Is there a way I can copy in the ParameterFields collection/array?
Thanks,
O.
I've CR9/C# application that calls the ReportDocument.SetDataSource method, passing it a DataTable populated earlier.
The report, if run on its own, requires four variables. The report Stored Proc gets called earlier through code, hence my using SetDataSource to pass-in the data.
My problem is that I use a couple of the report parameters in the report's design (DateFrom, DateTo, etc.). When I change the DataSource it clears out the ParameterFields array. So I'm looking for an easy way to store and re-create the parameters. I've tried the following which does store the variables in a ParameterFields object:
CrystalDecisions.Shared.ParameterFields crParams = new CrystalDecisions.Shared.ParameterFields(rptTest.DataDefinition.ParameterFields);
However executing the following later doesn't work:
rptTest.DataDefinition.ParameterFields = crParams;
(error message="Cannot implicitly convert type 'CrystalDecisions.Shared.ParameterFields' to 'CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions'")
Is there a way I can copy in the ParameterFields collection/array?
Thanks,
O.