Is it possible to implement a CSS class in crystal reports for Visual Studio 2012 (winform or WPF application)?

Boanerge picture Boanerge · Aug 2, 2013 · Viewed 8.9k times · Source

I need to change the font size of data label in bars but it's not possible with the visual studio version of crystal reports. I think that I can change it using a cssClass, but I have never used css with crystal reports.

How can I implement Css classes in crystal reports for Desktop?

Answer

Dineshcool picture Dineshcool · Aug 2, 2013

Yes. you can do this.

1.Right-click in the embedded Crystal Reports Designer and select Set CSS Class.
2.In the Object Scope field, select the objects or sections you would like the class to be applied to.
3.Enter the name of the class in the CSS Class Name field.

Tip Use CssClass in the Properties window to view, edit, or delete the class values for a specific report object or section.

4.Click OK.
5.Save the report.
6.Access the .aspx file in your project.
7.In the HTML tab of the .aspx file, reference an external style sheet that has the class already defined, or enter the class value.

For example:

<HTML>
    <STYLE>
        .classname
        {
            background-color:808080; border-color:000000; color:000000; font-family:Arial; font-weight:bold; font-style:italic; }
   <STYLE>
</HTML>

Source: MSDN

I Hope it will help you.