Print Page | Close Window

"display string"

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3502
Printed Date: 19 May 2024 at 3:28am


Topic: "display string"
Posted By: epaga
Subject: "display string"
Date Posted: 22 Jun 2008 at 11:41pm
hey there, sorry, but another API question. (see also my http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=3477 - other API question)

how do I access the display string formula? What I'm trying is once I have a ReportObject, to access the formula via:

                ConditionFormula f = obj.Format.ConditionFormulas[CrObjectFormatConditionFormulaTypeEnum.crObjectFormatConditionFormulaTypeDisplayString];

Unfortunately f.Text is always null even if I have a display string formula set for the object.

Any thoughts?

Thanks so much,
epaga

edited: f.Text is null, not f itself.



Replies:
Posted By: BrianBischof
Date Posted: 24 Jun 2008 at 12:11am
If you're still having problems, can you give me a little more info? What API are you using? C#? And what class is 'obj' defined as?

To set the record selection formula, I use the an instance of the ReportDocument class (my report object) and reference the property RecordSelectionFormula.



-------------
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>


Posted By: epaga
Date Posted: 24 Jun 2008 at 2:33am
Hi, sorry for the missing info.

Using the RAS SDK with C#. obj is a ReportObject.

I don't want the record selection formula, I want the "display string" formula, the one you can use to customize the actual output of the value.


Posted By: BrianBischof
Date Posted: 24 Jun 2008 at 2:38pm

I see. ReportObject is a base class. You have to case it as whatever the actual class it and then reference its properties. However, I still don't understand your original code if it is in C#. You're trying to reference the ConditionFormulas array from the Format property? I need to install CR 2008 on top of my VS 2008 virtual machine to see what this is doing. So many virtual machines on my hard drive.... 



-------------
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>


Posted By: epaga
Date Posted: 25 Jun 2008 at 1:32am
yeah, see the RAS API here: < ="Content-" content="text/; charset=utf-8">< name="GENERATOR" content="BLOCKNOTE.NET"><>BODY { FONT-FAMILY:Verdana; FONT-SIZE:10pt } P { FONT-FAMILY:Verdana; FONT-SIZE:10pt } DIV { FONT-FAMILY:Verdana; FONT-SIZE:10pt } TD { FONT-FAMILY:Verdana; FONT-SIZE:10pt } http://support.businessobjects.com/global/interactive/xi/om/RAS/default.html - http://support.businessobjects.com/global/interactive/xi/om/RAS/default.html

You can reference the conditionformulas array from the ObjectFormat class. But as you can see it doesn't help for getting the display string formula.

As far as I can tell, they shipped the new API with tons of theoretically offered functionality, but there are a few things like this and the BooleanGroupOptions that apparently are flat out not implemented yet.


Posted By: BrianBischof
Date Posted: 25 Jun 2008 at 9:50am
Thanks, I'll check it out (I'm building a RAS 2008 virtual machine as I write this. No better time than the present to get my hands dirty...)
 
I talked to one of the developers a few weeks ago about RAS functionality and he was asking me what I thought it needed versus what it currently has (they are trying to beef it up). So if you wanted to put together a list in the 'New Features' section of the forum, I know that they come to the website periodically to check it out. But you have to be specific with requests, because they don't pay as much attention to generic complaining. Also put 'RAS 2008' in the header so that it's clear what it applies to.


-------------
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>


Posted By: BrianBischof
Date Posted: 25 Jun 2008 at 10:13am

One thing that occurred to me is that the new RAS API gives you complete control to create a report from scratch. The only way for this to be possible is for there to be a property which gives r/w access for every aspect of a report. Thus, if it is part of a report, you should be able to reference/change it. Thus, it has to be in the object model SOMEWHERE.

Also, in the earlier comment you said that obj is a ReportObject. Have you looked at ReportDocument.ReportClientDocument yet? This is the object which gives you access to the full report creation API (RCAPI). If you haven't tried this one yet, it might be a better route to take.


-------------
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>


Posted By: BrianBischof
Date Posted: 25 Jun 2008 at 5:17pm
I spent the afternoon setting up a RAS 2008 virtual machine and I still can't get it working. There isn't any documentation on how to get it setup and working. Everything I find is with for RAS 9 (many years out of date) or XI. The XI samples should work, but that is assuming that RAS is installed properly. So I'm having a heck of a time with this.
 
Also, for what you are doing, I'm thinking that you are using the improved object model that gets installed with CR 2008, but you're not using the RAS. The RAS is completely separate from the .NET API and gives you ten times more functionality. Is this true?


-------------
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>


Posted By: epaga
Date Posted: 25 Jun 2008 at 11:46pm
Well I'm using the ReportDocument.ReportClientDocument and then working my way from there...

Haven't heard of the RCAPI yet, so I'll look into that.

Yeah the documentation is really, really sparse, the object model is huge, but as you can see there are certain things missing.


Posted By: BrianBischof
Date Posted: 26 Jun 2008 at 8:05am
You're doing it right then. RCAPI is just the old acronym for this. I can't get mine to work at all and I'm debugging it now. When I do the following line:

rcd = rd.ReportClientDocument;

I get the error:
"The ReportClientDocument property can only be accessed when the report is opened using a Report Application Server".

It's making me crazy....


-------------
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>


Posted By: BrianBischof
Date Posted: 26 Jun 2008 at 11:41am
Finally got it working! For some reason, it was adding CR Basic DLLs to my app, even though I had upgraded to CR 2008. But now it's all good and I can look into your questions.

-------------
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>


Posted By: epaga
Date Posted: 27 Jun 2008 at 12:04am
Awesome! Clap I look forward to hearing what you find out.

Thanks so much for all your work!

epaga


Posted By: BrianBischof
Date Posted: 27 Jun 2008 at 12:30am
Good news and bad news. I figured it out, but there is a bug on the property you need. Display String always returns null. The other condtional formulas work (but it is only a limited set), but not Display String. I'm going to email my contact at BOBJ to see if they are aware of this for a future service pack. Here is the code snippet:


ReportObjects myReportObjects;
myReportObjects = rcd.ReportDefController.ReportObjectController.GetAllReportObjects();
ISCRReportObject myObj;
myObj = (ISCRReportObject)myReportObjects[0]; //use whichever object you want
string myFormula;
myFormula = myObj.Format.ConditionFormulas[CrObjectFormatConditionFormulaTypeEnum.crObjectFormatConditionFormulaTypeDisplayString].Text;




-------------
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>


Posted By: BrianBischof
Date Posted: 27 Jun 2008 at 3:54pm
Here is another update (I've obviously have become obsessed with this question for the past two days). I found that the DisplayText and CSSClass conditional formulas always return null for ISCRFieldObject. However, they work fine for formulas. Interesting.

Now I'm off to see if I can figure out your grouping question.


-------------
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>


Posted By: epaga
Date Posted: 03 Jul 2008 at 6:49am
*ping* :)

Any news on the boolean grouping question, or the other questions?

Thanks again!


Posted By: epaga
Date Posted: 17 Jul 2008 at 11:52pm
*ping* Any news yet? It looks like it's been a while since you've been on the forum so I'd understand if you just don't have the time. Just wanted to check in again to see if anything came out of your looking in to the grouping questions... thanks...



Print Page | Close Window