|
-
Jul 27th, 2010, 11:46 PM
#1
[RESOLVED] Set top property of text object and field object of crystal reports during runtime
Hi,
In my reports, i have four controls.
1. Comments (Text Object) and Comments (Field object )w/ top properties of 3465.
2. Recommendations (Text Object) and Recommendations (Field object ) w/ top properties of 4505.
Here's what i need to do..
Logic:
Code:
if ((recommendations field object != null) && (comments field object == null)))
If true, set top properties of Recommendations Text object and commendations Field object to 3465.
How can we check if a field object has text/contents in C#/vb.net code? Is this possible?
If not, Is there a workaround solution for this??
Regards,
Greg
-
Jul 29th, 2010, 08:02 AM
#2
Sleep mode
Re: Set top property of text object and field object of crystal reports during runtim
-
Jul 29th, 2010, 09:27 AM
#3
Re: Set top property of text object and field object of crystal reports during runtim
Pirate,
Tnx for the link..But my scenario does not involve parameters..It will retrieve a data from field object control in crystal reports..
Based from my research, .NET does not support retrieving the value from a field object..
My problem is how can i set the top property of text object control and field object control during runtime..
Tnx
Greg
-
Jul 30th, 2010, 08:34 AM
#4
Re: Set top property of text object and field object of crystal reports during runtim
One technique is to use a simple Report Formula.
Code:
If IsNull ({comments field object}) Then
"Recommendations: " & {Recommendations field object}
Else
(
"Comments : " & {comments field object} & chr(13) &
"Recommendations: " & {Recommendations field object}
)
Replace the 4 objects on the report with the Formula object. Make sure its Can Grow property is set to true. The above code assumes the Recommendations field is never Null.
Let me know if that doesn't work for you and I will reply with another technique.
Last edited by brucevde; Jul 30th, 2010 at 08:38 AM.
-
Jul 31st, 2010, 11:46 PM
#5
Re: Set top property of text object and field object of crystal reports during runtim
hi bruce,
Just got the available time to reply this post.
The idea of substituting the field and text objects to formula fields was a solution..
What i did was, I added 4 formula fields in the report..The left side control
functions as the label, while the right side gets the data from data table..
Each control has its own formula... If recommendations is not null and comments is null, the data will be shown in the comments formula field...And the formula fields for recommendations (label and data field) will be suppressed..
Thanks for the tip...You mentioned earlier that there's another technique...What is behind this technique? Still formula fields?
Greg
-
Aug 1st, 2010, 01:16 AM
#6
Re: [RESOLVED] Set top property of text object and field object of crystal reports du
The other technique involves using multiple detail sections, setting the option "Underlay Following Section" and suppressing report objects. It all depends on the layout of the report but here is a simple example.
Code:
Details a Other Field Objects Comments (Text Object) Comments (Field object )
Details b Recommendations (Text Object) Recommendations (Field object )
If Customer 1 has both a Comment and a Recommendation but Customer 2 only had a Recommendation the report output would be
Code:
Customer 1 Comments: Some long comments
Recommendations: Cancel their account
Customer 2 Comments:
Recommendations: Raise their credit limit.
But by setting the following 3 Formulas to IsNull({Comments Database Field})
Details A Section "Underlay Following Section" option
Comments Text object Suppress option
Comments Field object Suppress option
The above report will produce
Code:
Customer 1 Comments: Some long comments
Recommendations: Cancel their account
Customer 2 Recommendations: Raise credit limit.
Last edited by brucevde; Aug 1st, 2010 at 01:19 AM.
-
Aug 1st, 2010, 09:59 AM
#7
Re: [RESOLVED] Set top property of text object and field object of crystal reports du
Thanks bruce..
I'll put this under my signature as future reference..
Greg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|