Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: customizing the crystal report font style Post Reply Post New Topic
Author Message
dhanaraj
Newbie
Newbie
Avatar

Joined: 25 Oct 2008
Online Status: Offline
Posts: 17
Quote dhanaraj Replybullet Topic: customizing the crystal report font style
     Posted: 03 Nov 2008 at 12:56pm
hi,

I want to change the crystal report font style in the following fields like column label, row label. how to change this through c#.net windows application coding? and my another problem is to i have retrieved the data from the sql server and then i bind them in the crystal report. in these some values are zero , and some values are negative how to suppress these through c#.net windows application

regards
dhanaraj
IP IP Logged
o2bnsv
Newbie
Newbie
Avatar

Joined: 14 Aug 2008
Location: United States
Online Status: Offline
Posts: 8
Quote o2bnsv Replybullet Posted: 07 Nov 2008 at 12:06pm
Why would you want to use c#.net to do this.  All this stuff can be easily done right in crystal by simply clicking on the column/row label etc. and selecting a new font.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 11 Nov 2008 at 3:53pm
The font can be done through C# if you need to.  You need to use the ReportDocument object model.  Then you need to walk through the ReportDocument.ReportDefinition.Sections property and look at the Kind property of each of the ReportObjects in the Section, convert the ReportObject to that Kind and set the Font property.  You can find more information in Brian's .NET programming book or by looking under the Crystal Reports .NET SDK linke here:
 
 
As for the negative and zero values, that you'll have to do in the report itself.  Right-click on the object that may have a negative or zero value and select the Format option.  On the Common tab, click on the formula button to the right of "Suppress" and add something like this:
 
{myTable.NumberField} <= 0
 
Use your table and field names.
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum