PivotViewConditionalFormatSetting doesn't seem to be working for me.
Is there a good way to troubleshoot this? Any logging that I could turn on/configure?
Here's my razor:
<SfPivotView TValue="FlattenedDetailedWIPBoardEntry" Height="500" AllowConditionalFormatting="true"> <!-- ShowGroupingBar="false" -->
<PivotViewDataSourceSettings DataSource="@detailedWIPBoard" ExpandAll="false" AllowLabelFilter="true" AllowMemberFilter="true" AllowValueFilter="true" EnableSorting=true>
<PivotViewColumns>
</PivotViewColumns>
<PivotViewRows>
<PivotViewRow Name="Zone" ShowSortIcon="true" />
<PivotViewRow Name="ProductionLineS95Id"/>
<PivotViewRow Name="LotId" />
</PivotViewRows>
<PivotViewValues>
<PivotViewValue Name="HoursInQueue" Caption="Total Hours in Queue" Type="SummaryTypes.Max" />
<PivotViewValue Name="HoursRunReady" Caption="Hours Run Ready" />
<PivotViewValue Name="OEEForDegas" Caption="OEE for Degas" />
<PivotViewValue Name="OEEForExpiration" Caption="OEE for Expiration" />
</PivotViewValues>
<PivotViewFormatSettings>
<PivotViewFormatSetting Name="HoursInQueue" Format="N"/>
</PivotViewFormatSettings>
<PivotViewConditionalFormatSettings>
<PivotViewConditionalFormatSetting Measure="HoursInQueue" Conditions="Condition.GreaterThan" Value1=1>
<PivotViewStyle BackgroundColor="#80cbc4" Color="black" FontFamily="Tahoma" FontSize="12px">
</PivotViewStyle>
</PivotViewConditionalFormatSetting>
<PivotViewConditionalFormatSetting Measure="HoursRunReady" Conditions="Condition.GreaterThan" Value1="1">
<PivotViewStyle BackgroundColor="#219122" Color="white" FontFamily="Tahoma" FontSize="12px">
</PivotViewStyle>
</PivotViewConditionalFormatSetting>
</PivotViewConditionalFormatSettings>
</PivotViewDataSourceSettings>
</SfPivotView>
Hi Brian,
We have checked the reported issue in latest NuGet version 21.2.3 and we are unable to reproduce the reported problem at our end. Meanwhile, we have prepared a sample for your reference. The sample is available in attachments.
Output Screenshots
Meanwhile, we suspect that reported problem may occur due to missing to add script reference in your Blazor Application. To know more about Adding Script reference, please refer the UG documentation below.
UG link : https://blazor.syncfusion.com/documentation/pivot-table/getting-started#add-script-reference
If the problem persists, please reproduce it in the provided sample and revert to us (or) send your sample that replicates the problem. This would allow us to investigate the reported problem at our end and provide a solution as soon as possible.
Thanks for looking at this & I appreciateyour detailed result. Impressive!
My description wasn't very detailed (sorry).
I'm using VS 2022, the solution is using the Blazor Server App temple & with a target of .net core 6
As a result the scripts where referenced in the _Layout.cshtml file.
I loaded your sample soltion & could reproduce the problem my removing the Year & Quarter columns (moving them to rows as follows (in the Index.razor file, in bold italics):
<SfPivotView TValue="ProductDetails" @ref="Pivot" Height="340" AllowCalculatedField="true" AllowConditionalFormatting="true" ShowFieldList="true">
<PivotViewDataSourceSettings DataSource="@dataSource">
<PivotViewColumns>
<!---
<PivotViewColumn Name="Year"></PivotViewColumn>
<PivotViewColumn Name="Quarter"></PivotViewColumn>
-->
</PivotViewColumns>
<PivotViewRows>
<PivotViewRow Name="Country"></PivotViewRow>
<PivotViewRow Name="Products"></PivotViewRow>
<PivotViewRow Name="Year"></PivotViewRow>
<PivotViewRow Name="Quarter"></PivotViewRow>
</PivotViewRows>
<PivotViewValues>
<PivotViewValue Name="Sold" Caption="Units Sold"></PivotViewValue>
<PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
</PivotViewValues>
<PivotViewConditionalFormatSettings>
<PivotViewConditionalFormatSetting Measure="Sold" Conditions="Condition.GreaterThan" Value1=1>
<PivotViewStyle BackgroundColor="#80cbc4" Color="black" FontFamily="Tahoma" FontSize="12px">
</PivotViewStyle>
</PivotViewConditionalFormatSetting>
<PivotViewConditionalFormatSetting Measure="Amount" Conditions="Condition.GreaterThan" Value1=0>
<PivotViewStyle BackgroundColor="#219122" Color="white" FontFamily="Tahoma" FontSize="12px">
</PivotViewStyle>
</PivotViewConditionalFormatSetting>
</PivotViewConditionalFormatSettings>
</PivotViewDataSourceSettings>
</SfPivotView>
Hi Brian,
Sorry for the inconvenience. We have considered the reported issue as a bug “Conditional formatting not applied properly when no fields are bound to the column axis”. And the fix for this issue will be available in our upcoming weekly release which is scheduled for May 23, 2023. You can track the same by using below link.
Regards,
Rajeshkannah G
Thanks
Hi Brian,
Welcome. We will notify once the issue has been resolved.
With regards,
Rajeshkannah G
Hi Brian,
We would like to let you know that when no column fields are bound to the pivot table, the values will act as Grand totals, and you can apply conditional formatting to it by enabling “ApplyGrandTotals” property in the PivotViewConditionalFormatSetting. Please look at the below code example below.
Code Example
<SfPivotView> <PivotViewConditionalFormatSettings> <PivotViewConditionalFormatSetting ApplyGrandTotals="true" Measure="Sold" Conditions="Condition.GreaterThan" Value1=1></PivotViewConditionalFormatSetting> </PivotViewConditionalFormatSettings> </SfPivotView> |
Output screenshot
Meanwhile, we have prepared a sample for your reference. Please find it in the attachments.
Regards,
Rajeshkannah G