Skip to content

Commit 8ac527e

Browse files
Merge pull request #4605 from syncfusion-content/BLAZ-Pivot-GettingStarted
894649: Updated Getting Started UG Document in Blazor Pivot Table-Hotfix
2 parents 0ad3d90 + be9ff5b commit 8ac527e

File tree

2 files changed

+131
-3
lines changed

2 files changed

+131
-3
lines changed

blazor/pivot-table/getting-started-webapp.md

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ In-order to define each field in the respective axis, the following basic proper
270270
{% endhighlight %}
271271
{% endtabs %}
272272

273-
N> [View Sample in GitHub.](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/PivotTable/BlazorWebApp)
273+
274274

275275
## Applying formatting to a value field
276276

@@ -313,7 +313,7 @@ N> Only fields from value section, which is in the form of numeric data values a
313313
{% endhighlight %}
314314
{% endtabs %}
315315

316-
After successful compilation of the application, simply press F5 to run the same. The pivot table component will render in the default web browser like below.
316+
* Press <kbd>Ctrl</kbd>+<kbd>F5</kbd> (Windows) or <kbd>⌘</kbd>+<kbd>F5</kbd> (macOS) to launch the application. This will render the Syncfusion Blazor Pivot Table component in your default web browser like below.
317317

318318
{% previewsample "https://blazorplayground.syncfusion.com/embed/rtVfZMqtrIxIbWRH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor PivotTable with Formatting](images/blazor-pivottable-formatting.png)" %}
319319

@@ -489,6 +489,70 @@ The calculated field feature allows user to insert or add a new calculated field
489489

490490
{% previewsample "https://blazorplayground.syncfusion.com/embed/BtrTDMUNBxfzcndb?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor PivotTable with Caluclation Button](images/blazor-pivottable-calculate-button.png)" %}
491491

492+
## Handling exceptions
493+
494+
Exceptions occurred during pivot table actions can be handled without stopping application. These error messages or exception details can be acquired using the [OnActionFailure](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.PivotView.PivotViewEvents-1.html#Syncfusion_Blazor_PivotView_PivotViewEvents_1_OnActionFailure) event.
495+
496+
The argument passed to the [OnActionFailure](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.PivotView.PivotViewEvents-1.html#Syncfusion_Blazor_PivotView_PivotViewEvents_1_OnActionFailure) event contains the error details returned from the server.
497+
498+
N> Recommend you to bind `OnActionFailure` event during your application development phase, this helps you to find any exceptions. You can pass these exception details to our support team to get solution as early as possible.
499+
500+
The following sample code demonstrates notifying user when server-side exception has occurred during data operation,
501+
502+
{% tabs %}
503+
{% highlight razor %}
504+
505+
<span class="error">@ErrorDetails</span>
506+
<SfPivotView TValue="PivotViewData" Width="100%" Height="450" AllowDataCompression="true" EnableVirtualization="true" ShowFieldList="true" ShowGroupingBar="true" MaxNodeLimitInMemberEditor="50">
507+
<PivotViewDataSourceSettings TValue="PivotViewData" Url="https://some.com/invalidUrl" ExpandAll="false" EnableSorting="true" EnableServerSideAggregation="true" AlwaysShowValueHeader="true">
508+
<PivotViewColumns>
509+
<PivotViewColumn Name="Year" Caption="Production Year"></PivotViewColumn>
510+
</PivotViewColumns>
511+
<PivotViewRows>
512+
<PivotViewRow Name="ProductID" Caption="Product ID"></PivotViewRow>
513+
</PivotViewRows>
514+
<PivotViewValues>
515+
<PivotViewValue Name="Sold" Caption="Unit Sold"></PivotViewValue>
516+
<PivotViewValue Name="Price" Caption="Unit Amount"></PivotViewValue>
517+
</PivotViewValues>
518+
<PivotViewFormatSettings>
519+
<PivotViewFormatSetting Name="Price" Format="C0"></PivotViewFormatSetting>
520+
<PivotViewFormatSetting Name="Sold" Format="N0"></PivotViewFormatSetting>
521+
</PivotViewFormatSettings>
522+
</PivotViewDataSourceSettings>
523+
<PivotViewGridSettings ColumnWidth="120"></PivotViewGridSettings>
524+
<PivotViewEvents TValue="PivotViewData" OnActionFailure="ActionFailure"></PivotViewEvents>
525+
</SfPivotView>
526+
527+
<style>
528+
.error {
529+
color: red;
530+
}
531+
</style>
532+
533+
@code{
534+
public string ErrorDetails = "";
535+
public class PivotViewData
536+
{
537+
public string ProductID { get; set; }
538+
public string Country { get; set; }
539+
public string Product { get; set; }
540+
public double Sold { get; set; }
541+
public double Price { get; set; }
542+
public string Year { get; set; }
543+
}
544+
public void ActionFailure(PivotActionFailureEventArgs args)
545+
{
546+
this.ErrorDetails = args.ErrorInfo.Message;
547+
StateHasChanged();
548+
}
549+
}
550+
551+
{% endhighlight %}
552+
{% endtabs %}
553+
554+
N> [View Sample in GitHub.](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/PivotTable/BlazorWebApp)
555+
492556
## See also
493557

494558
* [Getting Started with Syncfusion Blazor for Client-Side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-dotnet-cli)

blazor/pivot-table/getting-started.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ N> Only fields from value section, which is in the form of numeric data values a
334334
{% endhighlight %}
335335
{% endtabs %}
336336

337-
After successful compilation of the application, simply press F5 to run the same. The pivot table component will render in the default web browser like below.
337+
* Press <kbd>Ctrl</kbd>+<kbd>F5</kbd> (Windows) or <kbd>⌘</kbd>+<kbd>F5</kbd> (macOS) to launch the application. This will render the Syncfusion Blazor Pivot Table component in your default web browser like below.
338338

339339
{% previewsample "https://blazorplayground.syncfusion.com/embed/rtVfZMqtrIxIbWRH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor PivotTable with Formatting](images/blazor-pivottable-formatting.png)" %}
340340

@@ -510,6 +510,70 @@ The calculated field feature allows user to insert or add a new calculated field
510510

511511
{% previewsample "https://blazorplayground.syncfusion.com/embed/BtrTDMUNBxfzcndb?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor PivotTable with Caluclation Button](images/blazor-pivottable-calculate-button.png)" %}
512512

513+
## Handling exceptions
514+
515+
Exceptions occurred during pivot table actions can be handled without stopping application. These error messages or exception details can be acquired using the [OnActionFailure](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.PivotView.PivotViewEvents-1.html#Syncfusion_Blazor_PivotView_PivotViewEvents_1_OnActionFailure) event.
516+
517+
The argument passed to the [OnActionFailure](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.PivotView.PivotViewEvents-1.html#Syncfusion_Blazor_PivotView_PivotViewEvents_1_OnActionFailure) event contains the error details returned from the server.
518+
519+
N> Recommend you to bind `OnActionFailure` event during your application development phase, this helps you to find any exceptions. You can pass these exception details to our support team to get solution as early as possible.
520+
521+
The following sample code demonstrates notifying user when server-side exception has occurred during data operation,
522+
523+
{% tabs %}
524+
{% highlight razor %}
525+
526+
<span class="error">@ErrorDetails</span>
527+
<SfPivotView TValue="PivotViewData" Width="100%" Height="450" AllowDataCompression="true" EnableVirtualization="true" ShowFieldList="true" ShowGroupingBar="true" MaxNodeLimitInMemberEditor="50">
528+
<PivotViewDataSourceSettings TValue="PivotViewData" Url="https://some.com/invalidUrl" ExpandAll="false" EnableSorting="true" EnableServerSideAggregation="true" AlwaysShowValueHeader="true">
529+
<PivotViewColumns>
530+
<PivotViewColumn Name="Year" Caption="Production Year"></PivotViewColumn>
531+
</PivotViewColumns>
532+
<PivotViewRows>
533+
<PivotViewRow Name="ProductID" Caption="Product ID"></PivotViewRow>
534+
</PivotViewRows>
535+
<PivotViewValues>
536+
<PivotViewValue Name="Sold" Caption="Unit Sold"></PivotViewValue>
537+
<PivotViewValue Name="Price" Caption="Unit Amount"></PivotViewValue>
538+
</PivotViewValues>
539+
<PivotViewFormatSettings>
540+
<PivotViewFormatSetting Name="Price" Format="C0"></PivotViewFormatSetting>
541+
<PivotViewFormatSetting Name="Sold" Format="N0"></PivotViewFormatSetting>
542+
</PivotViewFormatSettings>
543+
</PivotViewDataSourceSettings>
544+
<PivotViewGridSettings ColumnWidth="120"></PivotViewGridSettings>
545+
<PivotViewEvents TValue="PivotViewData" OnActionFailure="ActionFailure"></PivotViewEvents>
546+
</SfPivotView>
547+
548+
<style>
549+
.error {
550+
color: red;
551+
}
552+
</style>
553+
554+
@code{
555+
public string ErrorDetails = "";
556+
public class PivotViewData
557+
{
558+
public string ProductID { get; set; }
559+
public string Country { get; set; }
560+
public string Product { get; set; }
561+
public double Sold { get; set; }
562+
public double Price { get; set; }
563+
public string Year { get; set; }
564+
}
565+
public void ActionFailure(PivotActionFailureEventArgs args)
566+
{
567+
this.ErrorDetails = args.ErrorInfo.Message;
568+
StateHasChanged();
569+
}
570+
}
571+
572+
{% endhighlight %}
573+
{% endtabs %}
574+
575+
N> [View Sample in GitHub.](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/PivotTable)
576+
513577
## See also
514578

515579
* [Getting Started with Syncfusion Blazor for Client-Side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-dotnet-cli)

0 commit comments

Comments
 (0)