SgDotNet
Singapore Professional .NET User Group -For Cool Developers

Crystal Reports on VS2003

rated by 0 users
This post has 2 Replies | 1 Follower

Top 100 Contributor
Posts 24
Sapphire Posted: 08-28-2007 3:57 PM

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?

Sapphire ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Accept others without judgement. Everyone is unique, and it's okay to be different. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Top 25 Contributor
Posts 240

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.

Top 100 Contributor
Posts 24

Hi.

Thanks for the tips.  Will look into it.  The issue somehow was solved by recreating the crystal report and another form for loading.

 

 

Sapphire ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Accept others without judgement. Everyone is unique, and it's okay to be different. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Page 1 of 1 (3 items) | RSS
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems