Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

Accessing individual elements of a textobject

$
0
0

Hi,

 

I'm using Crystal Reports 2008 in a .Net application.

 

I'm looping through each object in the report and applying colours at run time. We have certain text headings, fields, borders etc use use a single colour. We want to be able to change that colour without having to touch the individual reports.

 

So, the general approach is that if the object's font is not black then replace the colour with the new colour.

foreach (Crystal.ReportObject oO in oCurrentReport.ReportDefinition.ReportObjects)

{

if (oO is CrystalDecisions.CrystalReports.Engine.LineObject)

     {

          ...

     }

else if ((oO is CrystalDecisions.CrystalReports.Engine.TextObject))

     {

          ...

     }

}                      

 

This works fine for most objects but doesn't work for certain textobjects with multiple fonts:

[{@ReferenceHeading}: {@Ref}]

 

{@ReferenceHeading}: is specified to have a colour.

{@Ref}: is specified to be black

 

This results as one textobject - my question is how can I access each element of the textobject?

Crystal Reports itself can detect the difference because it does apply the different design time colouring.

 

I can't split out the objects from the textobject because {@ReferenceHeading} is a variable length and I want to maintain the look.

 

Any ideas?


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>