Aspose::Cells::IFormatCondition Class Referenceabstract

Represents conditional formatting condition. More...

Inherits Object.

Public Member Functions

virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormula1 (bool isR1C1, bool isLocal)=0
 Gets the value or expression associated with this format condition. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormula2 (bool isR1C1, bool isLocal)=0
 Gets the value or expression associated with this format condition. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormula1 (bool isR1C1, bool isLocal, Aspose::Cells::Systems::Int32 row, Aspose::Cells::Systems::Int32 column)=0
 Gets the value or expression of the conditional formatting of the cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormula2 (bool isR1C1, bool isLocal, Aspose::Cells::Systems::Int32 row, Aspose::Cells::Systems::Int32 column)=0
 Gets the value or expression of the conditional formatting of the cell. More...
 
virtual void SetFormulas (intrusive_ptr< Aspose::Cells::Systems::String > formula1, intrusive_ptr< Aspose::Cells::Systems::String > formula2, bool isR1C1, bool isLocal)=0
 Sets the value or expression associated with this format condition. More...
 
virtual void SetFormula1 (intrusive_ptr< Aspose::Cells::Systems::String > formula, bool isR1C1, bool isLocal)=0
 Sets the value or expression associated with this format condition. More...
 
virtual void SetFormula2 (intrusive_ptr< Aspose::Cells::Systems::String > formula, bool isR1C1, bool isLocal)=0
 Sets the value or expression associated with this format condition. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormula1 ()=0
 Gets and sets the value or expression associated with conditional formatting. More...
 
virtual void SetFormula1 (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets the value or expression associated with conditional formatting. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormula1 (Aspose::Cells::Systems::Int32 row, Aspose::Cells::Systems::Int32 column)=0
 Gets the formula of the conditional formatting of the cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormula2 ()=0
 Gets the value or expression associated with conditional formatting. More...
 
virtual void SetFormula2 (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets the value or expression associated with conditional formatting. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormula2 (Aspose::Cells::Systems::Int32 row, Aspose::Cells::Systems::Int32 column)=0
 Gets the formula of the conditional formatting of the cell. More...
 
virtual Aspose::Cells::OperatorType GetOperator ()=0
 Gets the conditional format operator type. More...
 
virtual void SetOperator (Aspose::Cells::OperatorType value)=0
 Sets the conditional format operator type. More...
 
virtual bool GetStopIfTrue ()=0
 True, no rules with lower priority may be applied over this rule, when this rule evaluates to true. Only applies for Excel 2007; More...
 
virtual void SetStopIfTrue (bool value)=0
 True, no rules with lower priority may be applied over this rule, when this rule evaluates to true. Only applies for Excel 2007; More...
 
virtual Aspose::Cells::Systems::Int32 GetPriority ()=0
 The priority of this conditional formatting rule. This value is used to determine which format should be evaluated and rendered. Lower numeric values are higher priority than higher numeric values, where '1' is the highest priority. More...
 
virtual void SetPriority (Aspose::Cells::Systems::Int32 value)=0
 The priority of this conditional formatting rule. This value is used to determine which format should be evaluated and rendered. Lower numeric values are higher priority than higher numeric values, where '1' is the highest priority. More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleGetIStyle ()=0
 Gets style of conditional formatted cell ranges. More...
 
virtual void SetIStyle (intrusive_ptr< Aspose::Cells::IStyle > value)=0
 Sets style of conditional formatted cell ranges. More...
 
virtual Aspose::Cells::FormatConditionType GetType ()=0
 Gets whether the conditional format Type. More...
 
virtual void SetType (Aspose::Cells::FormatConditionType value)=0
 Sets whether the conditional format Type. More...
 
virtual intrusive_ptr< Aspose::Cells::IIconSetGetIIconSet ()=0
 Get the conditional formatting's "IIconSet" instance. The default instance's IconSetType is TrafficLights31. Valid only for type = IconSet. More...
 
virtual intrusive_ptr< Aspose::Cells::IDataBarGetIDataBar ()=0
 Get the conditional formatting's "IDataBar" instance. The default instance's color is blue. Valid only for type is DataBar. More...
 
virtual intrusive_ptr< Aspose::Cells::IColorScaleGetIColorScale ()=0
 Get the conditional formatting's "IColorScale" instance. The default instance is a "green-yellow-red" 3ColorScale . Valid only for type = ColorScale. More...
 
virtual intrusive_ptr< Aspose::Cells::ITop10GetITop10 ()=0
 Get the conditional formatting's "Top10" instance. The default instance's rule highlights cells whose values fall in the top 10 bracket. Valid only for type is Top10. More...
 
virtual intrusive_ptr< Aspose::Cells::IAboveAverageGetIAboveAverage ()=0
 Get the conditional formatting's "AboveAverage" instance. The default instance's rule highlights cells that are above the average for all values in the range. Valid only for type = AboveAverage. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetText ()=0
 The text value in a "text contains" conditional formatting rule. Valid only for type = containsText, notContainsText, beginsWith and endsWith. The default value is null. More...
 
virtual void SetText (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 The text value in a "text contains" conditional formatting rule. Valid only for type = containsText, notContainsText, beginsWith and endsWith. The default value is null. More...
 
virtual Aspose::Cells::TimePeriodType GetTimePeriod ()=0
 The applicable time period in a "date occurring��" conditional formatting rule. Valid only for type = timePeriod. The default value is TimePeriodType.Today. More...
 
virtual void SetTimePeriod (Aspose::Cells::TimePeriodType value)=0
 The applicable time period in a "date occurring��" conditional formatting rule. Valid only for type = timePeriod. The default value is TimePeriodType.Today. More...
 

Detailed Description

Represents conditional formatting condition.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
intrusive_ptr<IWorksheet> sheet = workbook->GetIWorksheets()->GetObjectByIndex(0);
<br>//Adds an empty conditional formatting
int index = sheet->GetIConditionalFormattings()->Add();
intrusive_ptr<IFormatConditionCollection> fcs = sheet->GetIConditionalFormattings()->GetObjectByIndex(index);
<br>//Sets the conditional format range.
intrusive_ptr<ICellArea> ca = Factory::CreateICellArea();
ca->SetstartRow(0);
ca->SetendRow(0);
ca->SetstartColumn(0);
ca->SetendColumn(0);
fcs->AddArea(ca);
ca->SetstartRow(1);
ca->SetendRow(1);
ca->SetstartColumn(1);
ca->SetendColumn(1);
fcs->AddArea(ca);
//Adds condition.
int conditionIndex = fcs->AddCondition(FormatConditionType_CellValue, OperatorType_Between, new String("=A2"), new String("100"));
<br>//Adds condition.
int conditionIndex2 = fcs->AddCondition(FormatConditionType_CellValue, OperatorType_Between, new String("50"), new String("100"));
<br>//Sets the background color.
intrusive_ptr<IFormatCondition> fc = fcs->GetObjectByIndex(conditionIndex);
fc->GetIStyle()->SetBackgroundColor(Color::GetRed());
//Saving the Excel file
workbook->Save(new String("D:\\output.xls"));

Member Function Documentation

◆ GetFormula1() [1/4]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IFormatCondition::GetFormula1 ( bool  isR1C1,
bool  isLocal 
)
pure virtual

Gets the value or expression associated with this format condition.

Parameters
isR1C1Whether the formula needs to be formatted as R1C1.
isLocalWhether the formula needs to be formatted by locale.
Returns
The value or expression associated with this format condition.

◆ GetFormula1() [2/4]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IFormatCondition::GetFormula1 ( bool  isR1C1,
bool  isLocal,
Aspose::Cells::Systems::Int32  row,
Aspose::Cells::Systems::Int32  column 
)
pure virtual

Gets the value or expression of the conditional formatting of the cell.

Parameters
isR1C1Whether the formula needs to be formatted as R1C1.
isLocalWhether the formula needs to be formatted by locale.
rowThe row index.
columnThe column index.
Returns
The value or expression associated with the conditional formatting of the cell.

The given cell must be contained by this conditional formatting, otherwise null will be returned.

◆ GetFormula1() [3/4]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IFormatCondition::GetFormula1 ( )
pure virtual

Gets and sets the value or expression associated with conditional formatting.

Please add all areas before setting formula. For setting formula for this condition, if the input value starts with '=', then it will be taken as formula. Otherwise it will be taken as plain value(text, number, bool). For text value that starts with '=', user may input it as formula in format: "=\"=..."".

◆ GetFormula1() [4/4]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IFormatCondition::GetFormula1 ( Aspose::Cells::Systems::Int32  row,
Aspose::Cells::Systems::Int32  column 
)
pure virtual

Gets the formula of the conditional formatting of the cell.

Parameters
rowThe row index.
columnThe column index.
Returns
The formula.

◆ GetFormula2() [1/4]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IFormatCondition::GetFormula2 ( bool  isR1C1,
bool  isLocal 
)
pure virtual

Gets the value or expression associated with this format condition.

Parameters
isR1C1Whether the formula needs to be formatted as R1C1.
isLocalWhether the formula needs to be formatted by locale.
Returns
The value or expression associated with this format condition.

◆ GetFormula2() [2/4]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IFormatCondition::GetFormula2 ( bool  isR1C1,
bool  isLocal,
Aspose::Cells::Systems::Int32  row,
Aspose::Cells::Systems::Int32  column 
)
pure virtual

Gets the value or expression of the conditional formatting of the cell.

Parameters
isR1C1Whether the formula needs to be formatted as R1C1.
isLocalWhether the formula needs to be formatted by locale.
rowThe row index.
columnThe column index.
Returns
The value or expression associated with the conditional formatting of the cell.

The given cell must be contained by this conditional formatting, otherwise null will be returned.

◆ GetFormula2() [3/4]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IFormatCondition::GetFormula2 ( )
pure virtual

Gets the value or expression associated with conditional formatting.

Please add all areas before setting formula. For setting formula for this condition, if the input value starts with '=', then it will be taken as formula. Otherwise it will be taken as plain value(text, number, bool). For text value that starts with '=', user may input it as formula in format: "=\"=..."".

◆ GetFormula2() [4/4]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IFormatCondition::GetFormula2 ( Aspose::Cells::Systems::Int32  row,
Aspose::Cells::Systems::Int32  column 
)
pure virtual

Gets the formula of the conditional formatting of the cell.

Parameters
rowThe row index.
columnThe column index.
Returns
The formula.

◆ GetIAboveAverage()

virtual intrusive_ptr<Aspose::Cells::IAboveAverage> Aspose::Cells::IFormatCondition::GetIAboveAverage ( )
pure virtual

Get the conditional formatting's "AboveAverage" instance. The default instance's rule highlights cells that are above the average for all values in the range. Valid only for type = AboveAverage.

Returns

◆ GetIColorScale()

virtual intrusive_ptr<Aspose::Cells::IColorScale> Aspose::Cells::IFormatCondition::GetIColorScale ( )
pure virtual

Get the conditional formatting's "IColorScale" instance. The default instance is a "green-yellow-red" 3ColorScale . Valid only for type = ColorScale.

Returns

◆ GetIDataBar()

virtual intrusive_ptr<Aspose::Cells::IDataBar> Aspose::Cells::IFormatCondition::GetIDataBar ( )
pure virtual

Get the conditional formatting's "IDataBar" instance. The default instance's color is blue. Valid only for type is DataBar.

Returns

◆ GetIIconSet()

virtual intrusive_ptr<Aspose::Cells::IIconSet> Aspose::Cells::IFormatCondition::GetIIconSet ( )
pure virtual

Get the conditional formatting's "IIconSet" instance. The default instance's IconSetType is TrafficLights31. Valid only for type = IconSet.

Returns

◆ GetIStyle()

virtual intrusive_ptr<Aspose::Cells::IStyle> Aspose::Cells::IFormatCondition::GetIStyle ( )
pure virtual

Gets style of conditional formatted cell ranges.

◆ GetITop10()

virtual intrusive_ptr<Aspose::Cells::ITop10> Aspose::Cells::IFormatCondition::GetITop10 ( )
pure virtual

Get the conditional formatting's "Top10" instance. The default instance's rule highlights cells whose values fall in the top 10 bracket. Valid only for type is Top10.

Returns

◆ GetOperator()

virtual Aspose::Cells::OperatorType Aspose::Cells::IFormatCondition::GetOperator ( )
pure virtual

Gets the conditional format operator type.

OperatorType

◆ GetPriority()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IFormatCondition::GetPriority ( )
pure virtual

The priority of this conditional formatting rule. This value is used to determine which format should be evaluated and rendered. Lower numeric values are higher priority than higher numeric values, where '1' is the highest priority.

◆ GetStopIfTrue()

virtual bool Aspose::Cells::IFormatCondition::GetStopIfTrue ( )
pure virtual

True, no rules with lower priority may be applied over this rule, when this rule evaluates to true. Only applies for Excel 2007;

◆ GetText()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IFormatCondition::GetText ( )
pure virtual

The text value in a "text contains" conditional formatting rule. Valid only for type = containsText, notContainsText, beginsWith and endsWith. The default value is null.

◆ GetTimePeriod()

virtual Aspose::Cells::TimePeriodType Aspose::Cells::IFormatCondition::GetTimePeriod ( )
pure virtual

The applicable time period in a "date occurring��" conditional formatting rule. Valid only for type = timePeriod. The default value is TimePeriodType.Today.

◆ GetType()

virtual Aspose::Cells::FormatConditionType Aspose::Cells::IFormatCondition::GetType ( )
pure virtual

Gets whether the conditional format Type.

FormatConditionType

◆ SetFormula1() [1/2]

virtual void Aspose::Cells::IFormatCondition::SetFormula1 ( intrusive_ptr< Aspose::Cells::Systems::String >  formula,
bool  isR1C1,
bool  isLocal 
)
pure virtual

Sets the value or expression associated with this format condition.

Parameters
formulaThe value or expression associated with this format condition. If the input value starts with '=', then it will be taken as formula. Otherwise it will be taken as plain value(text, number, bool). For text value that starts with '=', user may input it as formula in format: "=\"=..."".</param> <param name="isR1C1" >Whether the formula is R1C1 formula.</param> <param name="isLocal" >Whether the formula is locale formatted.

◆ SetFormula1() [2/2]

virtual void Aspose::Cells::IFormatCondition::SetFormula1 ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Sets the value or expression associated with conditional formatting.

Please add all areas before setting formula. For setting formula for this condition, if the input value starts with '=', then it will be taken as formula. Otherwise it will be taken as plain value(text, number, bool). For text value that starts with '=', user may input it as formula in format: "=\"=..."".

◆ SetFormula2() [1/2]

virtual void Aspose::Cells::IFormatCondition::SetFormula2 ( intrusive_ptr< Aspose::Cells::Systems::String >  formula,
bool  isR1C1,
bool  isLocal 
)
pure virtual

Sets the value or expression associated with this format condition.

Parameters
formulaThe value or expression associated with this format condition. If the input value starts with '=', then it will be taken as formula. Otherwise it will be taken as plain value(text, number, bool). For text value that starts with '=', user may input it as formula in format: "=\"=..."".</param> <param name="isR1C1" >Whether the formula is R1C1 formula.</param> <param name="isLocal" >Whether the formula is locale formatted.

◆ SetFormula2() [2/2]

virtual void Aspose::Cells::IFormatCondition::SetFormula2 ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Sets the value or expression associated with conditional formatting.

Please add all areas before setting formula. For setting formula for this condition, if the input value starts with '=', then it will be taken as formula. Otherwise it will be taken as plain value(text, number, bool). For text value that starts with '=', user may input it as formula in format: "=\"=..."".

◆ SetFormulas()

virtual void Aspose::Cells::IFormatCondition::SetFormulas ( intrusive_ptr< Aspose::Cells::Systems::String >  formula1,
intrusive_ptr< Aspose::Cells::Systems::String >  formula2,
bool  isR1C1,
bool  isLocal 
)
pure virtual

Sets the value or expression associated with this format condition.

Parameters
formula1The value or expression associated with this format condition. If the input value starts with '=', then it will be taken as formula. Otherwise it will be taken as plain value(text, number, bool). For text value that starts with '=', user may input it as formula in format: "=\"=..."".</param> <param name="formula2" >The value or expression associated with this format condition. The input format is same with formula1</param> <param name="isR1C1" >Whether the formula is R1C1 formula.</param> <param name="isLocal" >Whether the formula is locale formatted.

◆ SetIStyle()

virtual void Aspose::Cells::IFormatCondition::SetIStyle ( intrusive_ptr< Aspose::Cells::IStyle value)
pure virtual

Sets style of conditional formatted cell ranges.

◆ SetOperator()

virtual void Aspose::Cells::IFormatCondition::SetOperator ( Aspose::Cells::OperatorType  value)
pure virtual

Sets the conditional format operator type.

OperatorType

◆ SetPriority()

virtual void Aspose::Cells::IFormatCondition::SetPriority ( Aspose::Cells::Systems::Int32  value)
pure virtual

The priority of this conditional formatting rule. This value is used to determine which format should be evaluated and rendered. Lower numeric values are higher priority than higher numeric values, where '1' is the highest priority.

◆ SetStopIfTrue()

virtual void Aspose::Cells::IFormatCondition::SetStopIfTrue ( bool  value)
pure virtual

True, no rules with lower priority may be applied over this rule, when this rule evaluates to true. Only applies for Excel 2007;

◆ SetText()

virtual void Aspose::Cells::IFormatCondition::SetText ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

The text value in a "text contains" conditional formatting rule. Valid only for type = containsText, notContainsText, beginsWith and endsWith. The default value is null.

◆ SetTimePeriod()

virtual void Aspose::Cells::IFormatCondition::SetTimePeriod ( Aspose::Cells::TimePeriodType  value)
pure virtual

The applicable time period in a "date occurring��" conditional formatting rule. Valid only for type = timePeriod. The default value is TimePeriodType.Today.

◆ SetType()

virtual void Aspose::Cells::IFormatCondition::SetType ( Aspose::Cells::FormatConditionType  value)
pure virtual

Sets whether the conditional format Type.

FormatConditionType