Programmatically set colour to Crystal report objects
Hi all,

I need to programmatically set colour to Crystal report text objects. How can I do it?

See All Responses Below...
Message Rating
Posted on: 31/05/2012
Please try this code.

 private void ReportColorSettings(ReportDocument report)
            section = (Sections)report.ReportDefinition.Sections;
            for (int i = 0; i < section.Count; i++)

                foreach (ReportObject r in section[i].ReportObjects)
                    if (r.Kind.ToString() == "FieldObject")
                        FieldObject f = (FieldObject)r;
                        f.Color = System.Drawing.Color.Blue;

                    if (r.Kind.ToString() == "TextObject")
                        TextObject t = (TextObject)r;
                        t.Color = System.Drawing.Color.Black;
Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site. 

Academic Projects