Click here to Skip to main content
12,890,424 members (56,592 online)
Click here to Skip to main content
Add your own
alternative version

Stats

21.9K views
3.3K downloads
19 bookmarked
Posted 28 Jul 2011

ASP.NET Custom Control + Crystal Report Dynamic Text Format

, 28 Jul 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
Custom control for display client formatted text in Crystal report

Introduction

In this post, I describe how to dynamically apply format to Crystal report text. In Crystal Report, you can’t directly change color, font size, Style, alignment, etc. So I have created one custom composite control which helps you to format text object in Crystal report.

Background

In Crystal Report, Text Field object properties like Font size, color, style, etc. can’t change. For this, I used HTML editor but it can’t support some tags. So I decided to create my own control which can format the text from client side.

Using the Code

Here, I have used formula field to show the data in Crystal report.

Sample Image - maximum width is 600 pixels

In the below image, I show how to add display data in formula field.

Sample Image - maximum width is 600 pixels

In the below image, I show how to add formula for font size.

Sample Image - maximum width is 600 pixels

In the below image, I show how to add formula for font style.

Sample Image - maximum width is 600 pixels

In the following image, I show how to add formula for Text Alignment.

Sample Image - maximum width is 600 pixels

In the below image, I show how to add formula for Font Color.

Sample Image - maximum width is 600 pixels

//
// Actual Control and Data format.
//

Sample Image - maximum width is 600 pixels

Final Demo Project Screenshot

Sample Image - maximum width is 600 pixels

Your feedback is always welcome.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Sachin Somanath Mumbare
Software Developer
India India
He is working On C#,Asp.net,window communication foundation(WCF),Silverlight from past 4+ years.
He is flair for learning technology.He is active in programming communities and loves to share the knowledge with other developers whenever he gets the opportunity.

You may also be interested in...

Comments and Discussions

 
GeneralMy vote of 5 Pin
manoj kumar choubey3-Feb-12 17:59
membermanoj kumar choubey3-Feb-12 17:59 
Questionreg: Custom Control Pin
balaji092928-Oct-11 1:13
memberbalaji092928-Oct-11 1:13 
GeneralGood article Pin
Sujit Bhujbal2-Aug-11 5:17
memberSujit Bhujbal2-Aug-11 5:17 
QuestionOr... Pin
Selvin28-Jul-11 6:12
memberSelvin28-Jul-11 6:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 28 Jul 2011
Article Copyright 2011 by Sachin Somanath Mumbare
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid