Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: formatting at runtime Post Reply Post New Topic
Author Message
niranjana
Newbie
Newbie


Joined: 21 Nov 2007
Online Status: Offline
Posts: 15
Quote niranjana Replybullet Topic: formatting at runtime
     Posted: 19 Dec 2007 at 11:26pm
is it possible to dynamically pass the formatting options to crystal report?
ie formatting options like, page header displyed in bold type...like that
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 20 Dec 2007 at 4:57am
Yes, to a certain degree.  The simplest way to do this is with parameter fields.  Then, simply use your conditional formulas to reference the parameter fields and react accordingly.  As a caveat, I have run across some areas in Crystal that don't allow you to do this.  I think that it is part of the two-pass limitation.  They just won't accept complex formulas in their conditions.  Unfortunately, I can't recall off-hand which properties exhibited this limitation.

I think there is also a way for .Net to "reach into" a report and tweak settings.  I've seen it referenced as a power of using Crystal embedded in a wrapper program.  But, I've never done anything with it personally.  So, that will be up to Brian to respond to.


IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 20 Dec 2007 at 11:26am
Yes, if you're a .NET programmer then you can use the ReportDocument object model to modify the report properties prior to running a report. Thus, you can format the report header to be bold, change which data fields get printed, etc.

The mistake that most people run into is that they want to use .NET to modify the report with WHILE IT IS RUNNING. This can't be done. The object model is ONLY accessible prior to report generation. Once the report starts to run, it's hands off. That is why .NET programmers still need to learn how to use Crystal syntax with conditional formatting because that is the only way to modify a report while it's being processed.

If your using Crystal Reports .NET 2003, you can get my book Crystal Reports .NET Programming for detailed explanations of .NET customization. If you're using CR.NET 2005, then starting next month I'm creating a new section of the website where premier members can get access to my .NET 2005 chapters as I write them and also make requests for what they want me to write about. It should be pretty cool!
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
niranjana
Newbie
Newbie


Joined: 21 Nov 2007
Online Status: Offline
Posts: 15
Quote niranjana Replybullet Posted: 24 Dec 2007 at 5:17am
thank you sir
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