I am trying to use the RDC (craxdrt.dll v8.5.0.217) to get to my text boxes' conditional formatting formulas. According to Crystal's KBase article, it looks like they enhanced the RDC after v8.0 to include FieldElements. I have tried all syntax I can think of to try to get to this. I have a bunch of text fields with conditional formatting formulas for the BackColor property. Here's the VB code snippet I am using:
These 2 lines output the text box's name & value (works fine):
MsgBox crRpt.Areas.Item(a).Sections.Item(Int(s)).ReportObjects.Item(Int(ro)).Name
MsgBox crRpt.Areas.Item(a).Sections.Item(Int(s)).ReportObjects.Item(Int(ro)).Text
These next two lines are different variations of syntax I have tried to get to the conditional formatting:
MsgBox crRpt.Areas.Item(a).Sections.Item(Int(s)).ReportObjects.Item(Int(ro)).ConditionFormula
OR
MsgBox crRpt.Areas.Item(a).Sections.Item(Int(s)).ReportObjects.Item(Int(ro)).BackColor.ConditionFormula
When I try using either of these lines, I receive an error message stating "Object Required".
I get "Object does not support this property or method" when I try this:
MsgBox crRpt.Areas.Item(a).Sections.Item(Int(s)).ReportObjects.Item(Int(ro)).FieldElements(1).BackColor.ConditionFormula
Does anyone know how to correct this to retrieve the conditional formula? Ultimately I would like to be able to set the conditional formula through code -- has anyone been able to do this?
Thank you for any help or sample code.
These 2 lines output the text box's name & value (works fine):
MsgBox crRpt.Areas.Item(a).Sections.Item(Int(s)).ReportObjects.Item(Int(ro)).Name
MsgBox crRpt.Areas.Item(a).Sections.Item(Int(s)).ReportObjects.Item(Int(ro)).Text
These next two lines are different variations of syntax I have tried to get to the conditional formatting:
MsgBox crRpt.Areas.Item(a).Sections.Item(Int(s)).ReportObjects.Item(Int(ro)).ConditionFormula
OR
MsgBox crRpt.Areas.Item(a).Sections.Item(Int(s)).ReportObjects.Item(Int(ro)).BackColor.ConditionFormula
When I try using either of these lines, I receive an error message stating "Object Required".
I get "Object does not support this property or method" when I try this:
MsgBox crRpt.Areas.Item(a).Sections.Item(Int(s)).ReportObjects.Item(Int(ro)).FieldElements(1).BackColor.ConditionFormula
Does anyone know how to correct this to retrieve the conditional formula? Ultimately I would like to be able to set the conditional formula through code -- has anyone been able to do this?
Thank you for any help or sample code.