Hi All,
I populated a dataset before passing to an Crystal Report Object for display. It is working well. However, recently there are additional requirements that I need to manipulate the report title etc, I tried using setting of parameter. It does not appear in the Report. Is it true that once you use ADO.NET dataset for the CrystalReport, you lose all the ability to customise the report at runtime?
You can still set parameter values... if you are talking about crystal report parameters... Also I'm not sure whether you are manipulating the report from code?
You can also still manipulate the content, eg. set the text of a textobject object.
Crystal is finicky about the order in which you do things though - this is what works:
1) Set report datasource (what works for me is to recursively assign to each Table in each Subreport)
2) Assign to main report's unlinked parameters only:
Param.CurrentValues.Clear(); ParameterDiscreteValue ParamValue = new ParameterDiscreteValue(); ParamValue.Value = Msg; Param.CurrentValues.Add(ParamValue); ParamDef.ApplyCurrentValues(Param.CurrentValues);
3) Find the textobjects in ReportDefinition and assign to their Text property.
Also, be careful of re-using the same ReportDocument - it can cause unexpected results and when an exception occurs, re-using the ReportDocument will give you garbage.
Hi.
Thanks for the tips. Will look into it. The issue somehow was solved by recreating the crystal report and another form for loading.