on 2023 Apr 20 3:06 AM
I want to programmatically change the color to Black when printing (FieldObject, TextObject).
I've found a way, but it's not perfect.
My Code here..
List<FieldObject> fldobjitems = rd.ReportDefinition.ReportObjects.OfType<FieldObject>().ToList();
foreach (FieldObject fldobj in fldobjitems)
{
if (fldobj.Color != System.Drawing.Color.Black) fldobj.Color = System.Drawing.Color.Black;
}
.
.
.
Formulas for Color are defined in some fields, but they are not changed.
select CurrentFieldValue
case "-":
RGB(0,0,0)
default:
RGB(255,0,0)
Is there any workaround?
thanks.
Request clarification before answering.
You need to change the expression -- not the property value.
That is possible to do, but it is easier to simply use a parameter to control the expression and simply feed a value into that parameter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are report files that are already in use,
but there is a case where a customer requests all text colors to be black, so I am looking for a way to solve it programmatically.
I've found some workarounds, but it seems that fields with 'Format Field -> Font -> Color - Formula' cannot be changed programmatically.
Still looking for a way.
Thank you for your reply.
If you are using .NET then go here:
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
See my test app:
It has a drop down listbox that will get the formula, use it by cloning the object and then you can make changes to it.
Other than that as Ido suggested it may be simpler to just update their report
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
72 | |
30 | |
8 | |
7 | |
6 | |
6 | |
6 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.