-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dividend table and improve export format of the tables
- Loading branch information
Showing
7 changed files
with
67 additions
and
13 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
BlazorApp-Investment Tax Calculator/Components/DividendTable.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
@using Model | ||
@using Model.Interfaces; | ||
@using Syncfusion.Blazor.Grids; | ||
|
||
@inject IDividendLists dividendList | ||
|
||
<p>Imported Dividends and withholding taxes</p> | ||
|
||
<SfGrid ID="ImportedDividendGrid" @ref="importedDividendGrid" DataSource="@dividendList.Dividends" | ||
AllowPaging="true" AllowSorting="true" AllowPdfExport="true" AllowExcelExport="true" AllowResizing="true" | ||
Toolbar="@(new List<string>() { "PdfExport", "ExcelExport", "Print" })" Height="1000px"> | ||
<GridPageSettings PageSizes="true"></GridPageSettings> | ||
<GridEvents OnToolbarClick="ToolbarClickHandler" TValue="Dividend"></GridEvents> | ||
<GridColumns> | ||
<GridColumn Field=@nameof(Dividend.Date) HeaderText="Date" Format="d"></GridColumn> | ||
<GridColumn Field=@nameof(Dividend.DividendType) HeaderText="Dividend/Withholding tax"></GridColumn> | ||
<GridColumn Field=@nameof(Dividend.AssetName) HeaderText="Asset Name"></GridColumn> | ||
<GridColumn Field=@nameof(Dividend.CompanyLocation) HeaderText="Company location"></GridColumn> | ||
<GridColumn Field=@(nameof(Dividend.Proceed) + "." + nameof(DescribedMoney.BaseCurrencyAmount)) HeaderText="Sterling Amount"></GridColumn> | ||
<GridColumn Field=@(nameof(Dividend.Proceed) + "." + nameof(DescribedMoney.Amount)) HeaderText="Local Currency Amount"></GridColumn> | ||
<GridColumn Field=@(nameof(Dividend.Proceed) + "." + nameof(DescribedMoney.Description)) HeaderText="Description"></GridColumn> | ||
</GridColumns> | ||
</SfGrid> | ||
|
||
@code { | ||
private SfGrid<Dividend> importedDividendGrid = new(); | ||
|
||
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args) | ||
{ | ||
if (args.Item.Id == "ImportedDividendGrid_pdfexport") //Id is combination of Grid's ID and itemname | ||
{ | ||
var pdfExportProperties = new PdfExportProperties() | ||
{ | ||
PageOrientation = PageOrientation.Landscape, | ||
PageSize = PdfPageSize.A4 | ||
}; | ||
await importedDividendGrid.ExportToPdfAsync(pdfExportProperties); | ||
} | ||
if (args.Item.Id == "ImportedDividendGrid_excelexport") //Id is combination of Grid's ID and itemname | ||
{ | ||
await importedDividendGrid.ExportToExcelAsync(); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
BlazorApp-Investment Tax Calculator/Pages/DividendDataPage.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@page "/DividendDataPage" | ||
|
||
@using BlazorApp_Investment_Tax_Calculator.Components | ||
|
||
<DividendTable /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters