We are using Visual Studio 2013 Update 4; Crystal 13.0.12.1494. Here is the problem, and we have created a simple project that demonstrates our issue. WPF project with 1 form with the viewer. Load a report with an Oracle datasoure that just reads the data dictionary for a database table names. 1 report parameter to filter by table name. In the report file, the parameter is set to find 'TABLE1'. Right after loading the report, and before we assign it to the viewer, we need to change the parameter to 'TABLE2'. This works okay. The problem is then when the viewer refresh is clicked, and we prompt for new parameters, the parameter value reverts to back to the orignial from the report file 'TABLE1'. I need it to persist the values I had programatically set, 'TABLE2'. We have reports with dozens of parameters, our .Net application has the correct initial parameter values, not the report file, and it ins't viable for us to set them to anything of significance in the report file, they aren't always known until the user is in a particular part of our application. This is a major issue for us, any help is appreciated. Below is the codebehind from our simple c# example project.
Thanks,
Dominic.
public partial class Window1 : Window
{
CrystalDecisions.CrystalReports.Engine.ReportDocument Report;
public Window1()
{
InitializeComponent();
reportViewer.Owner = this;
Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
Report.Load("Crystal_Test.rpt");
Report.SetParameterValue("TABLE_NAME", "TABLE2");
reportViewer.ViewerCore.ReuseParameterWhenRefresh = false;
reportViewer.ViewerCore.ReportSource = Report;
}
}