SgDotNet
Singapore Professional .NET User Group -For Cool Developers

Crystal Reports on VS2003

Latest post 08-30-2007 9:25 AM by Sapphire. 2 replies.
  • 08-28-2007 3:57 PM

    • Sapphire
    • Top 100 Contributor
    • Joined on 04-21-2005
    • Singapore
    • Posts 24

    Crystal Reports on VS2003

    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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • 08-29-2007 6:08 PM In reply to

    • hannes
    • Top 25 Contributor
    • Joined on 05-04-2004
    • South Africa
    • Posts 240

    Re: Crystal Reports on VS2003

    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.

  • 08-30-2007 9:25 AM In reply to

    • Sapphire
    • Top 100 Contributor
    • Joined on 04-21-2005
    • Singapore
    • Posts 24

    Re: Crystal Reports on VS2003

    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