Good Day To All,
How can I add From Date and To Date in Datagrid PDF Export? my Source for Date is in Fig. no. 1 and my Sample PDF Report is in Fig. no. 2.. Thanks in Advance :) ..
Nelson
Good Day,
Thanks for the reply.. if possible to have date header in PDF Export? if yes can you give me example?
thanks..
Nelson
|
@code{
private SfGrid<Order> DefaultGrid;
public List<Order> Orders { get; set; }
public DateTime? StartValue { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 28);
public DateTime? EndValue { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 29);
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
{
if (args.Item.Id == "Grid_pdfexport") //Id is combination of Grid's ID and itemname
{
string val = StartValue.ToString() + " - " + EndValue.ToString();
List<PdfHeaderFooterContent> HeaderContent = new List<PdfHeaderFooterContent>
{
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = val , Position = new PdfPosition() { X = 0, Y = 50 }, Style = new PdfContentStyle() { TextBrushColor = "#000000", FontSize = 13 } }
};
PdfExportProperties ExportProperties = new PdfExportProperties();
PdfHeader Header = new PdfHeader()
{
FromTop = 0,
Height = 130,
Contents = HeaderContent
};
ExportProperties.Header = Header;
await this.DefaultGrid.PdfExport(ExportProperties);
}
}
|
Good Day Sir Jeevakanth SP and Syncfusion Team,
Thanks a lot for the reply.. :)
Take Care and God Bless..
Nelson
Good Day Sir
Jeevakanth SP
and Syncfusion Team,
If is impossible to create pdf export formats like in file I uploaded?
Thanks in Advance.. :)
Nelson
|
@using Syncfusion.Blazor.Grids
@using Syncfusion.Blazor.Calendars
<SfDateRangePicker TValue="DateTime?" StartDate="@StartValue" EndDate="@EndValue"></SfDateRangePicker>
<SfGrid ID="Grid" @ref="DefaultGrid" DataSource="@Orders" Toolbar="@(new List<string>() { "PdfExport" })" AllowPdfExport="true" AllowPaging="true">
<GridEvents OnToolbarClick="ToolbarClickHandler" TValue="Order"></GridEvents>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</SfGrid>
@code{
private SfGrid<Order> DefaultGrid;
public List<Order> Orders { get; set; }
public DateTime? StartValue { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 28);
public DateTime? EndValue { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 29);
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
{
if (args.Item.Id == "Grid_pdfexport") //Id is combination of Grid's ID and itemname
{
string val = "PO Report from " + StartValue.ToString() + " to " + EndValue.ToString() + "Vendor All";
List<PdfHeaderFooterContent> HeaderContent = new List<PdfHeaderFooterContent>
{
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = val , Position = new PdfPosition() { X = 0, Y = 50 }, Style = new PdfContentStyle() { TextBrushColor = "#000000", FontSize = 13 } },
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = "Payee Name: Name", Position = new PdfPosition() { X = 0, Y = 100 }, Style = new PdfContentStyle() { TextBrushColor = "#8B0000", FontSize = 13 } },
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = "Category: Category", Position = new PdfPosition() { X = 0, Y = 120 }, Style = new PdfContentStyle() { TextBrushColor = "#8B0000", FontSize = 13 } },
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = "Reference: Reference", Position = new PdfPosition() { X = 500, Y = 120 }, Style = new PdfContentStyle() { TextBrushColor = "#8B0000", FontSize = 13 } }
};
PdfExportProperties ExportProperties = new PdfExportProperties();
PdfHeader Header = new PdfHeader()
{
FromTop = 0,
Height = 150,
Contents = HeaderContent
};
ExportProperties.Header = Header;
await this.DefaultGrid.PdfExport(ExportProperties);
}
}
protected override void OnInitialized()
{
Orders = Enumerable.Range(1, 75).Select(x => new Order()
{
OrderID = 1000 + x,
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
Freight = 2.1 * x,
OrderDate = DateTime.Now.AddDays(-x),
}).ToList();
}
public class Order
{
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
}
} |
Good Day Sir Jeevakanth SP and Syncfusion Team,
Thanks Sir for your answer.. my another question how can i add "new PdfHeaderFooterContent() { Type = ContentType.Text, Value = "Payee Name: Name" for example and the Payee Name instead of Payee Name: Name I add Field=@nameof(Order.OrderID) like Payee Name: @nameof(Order.OrderID).. thanks in advance.
Nelson
|
@using Syncfusion.Blazor.Grids
@using Syncfusion.Blazor.Calendars
<SfDateRangePicker TValue="DateTime?" StartDate="@StartValue" EndDate="@EndValue"></SfDateRangePicker>
<SfGrid ID="Grid" @ref="DefaultGrid" DataSource="@Orders" Toolbar="@(new List<string>() { "PdfExport" })" AllowPdfExport="true" AllowPaging="true">
<GridEvents OnToolbarClick="ToolbarClickHandler" TValue="Order"></GridEvents>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</SfGrid>
@code{
private SfGrid<Order> DefaultGrid;
public List<Order> Orders { get; set; }
public DateTime? StartValue { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 28);
public DateTime? EndValue { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 29);
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
{
if (args.Item.Id == "Grid_pdfexport") //Id is combination of Grid's ID and itemname
{
string val = "PO Report from " + StartValue.ToString() + " to " + EndValue.ToString() + "Vendor All";
List<PdfHeaderFooterContent> HeaderContent = new List<PdfHeaderFooterContent>
{
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = val , Position = new PdfPosition() { X = 0, Y = 50 }, Style = new PdfContentStyle() { TextBrushColor = "#000000", FontSize = 13 } },
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = "Payee Name: "+nameof(Order.OrderID), Position = new PdfPosition() { X = 0, Y = 100 }, Style = new PdfContentStyle() { TextBrushColor = "#8B0000", FontSize = 13 } },
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = "Category: Category", Position = new PdfPosition() { X = 0, Y = 120 }, Style = new PdfContentStyle() { TextBrushColor = "#8B0000", FontSize = 13 } },
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = "Reference: Reference", Position = new PdfPosition() { X = 500, Y = 120 }, Style = new PdfContentStyle() { TextBrushColor = "#8B0000", FontSize = 13 } }
};
PdfExportProperties ExportProperties = new PdfExportProperties();
PdfHeader Header = new PdfHeader()
{
FromTop = 0,
Height = 150,
Contents = HeaderContent
};
ExportProperties.Header = Header;
await this.DefaultGrid.PdfExport(ExportProperties);
}
}
protected override void OnInitialized()
{
Orders = Enumerable.Range(1, 75).Select(x => new Order()
{
OrderID = 1000 + x,
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
Freight = 2.1 * x,
OrderDate = DateTime.Now.AddDays(-x),
}).ToList();
}
public class Order
{
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
}
} |
Hello Sir Jeevakanth SP.,
Thanks for the reply.. My question is how can I export in PDF with Headers like Ex No, Ex Date from, Ex Date to, Select Employee and Enter Remarks.. Please see Pic no. 1.. Another Question is how can I Export in PDF with details(Sub-grid) in Pic no. 2.. Thanks..
Nelson
1.
2.
Good Day Sir Jeevakanth SP,
Thanks for the reply.. if is possible to add PDF Export Header with value like in picture below?
Thanks and God Bless..
Nelson
|
<SfTextBox @bind-Value=@TextBoxValue></SfTextBox>
<SfGrid>
..
</SfGrid>
@code{
string TextBoxValue { get; set; } = "TextBoxText";
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
{
if (args.Item.Id == "Grid_pdfexport") //Id is combination of Grid's ID and itemname
{
string val = "PO Report from " + StartValue.ToString() + " to " + EndValue.ToString() + "Vendor All";
List<PdfHeaderFooterContent> HeaderContent = new List<PdfHeaderFooterContent>
{
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = val , Position = new PdfPosition() { X = 0, Y = 50 }, Style = new PdfContentStyle() { TextBrushColor = "#000000", FontSize = 13 } },
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = TextBoxValue, Position = new PdfPosition() { X = 0, Y = 120 }, Style = new PdfContentStyle() { TextBrushColor = "#8B0000", FontSize = 13 } }
};
PdfExportProperties ExportProperties = new PdfExportProperties();
PdfHeader Header = new PdfHeader()
{
FromTop = 0,
Height = 150,
Contents = HeaderContent
};
ExportProperties.Header = Header;
await this.DefaultGrid.PdfExport(ExportProperties);
}
} } |
Good Day Sir Jeevakanth SP. and Syncfusion Team,
Thanks for the reply.. :)
My Question is how can I add Header in Pivot Table PDF Export..
Thanks and God Bless.. :)
Nelson
|
public void beforeExport(BeforeExportEventArgs args)
{
string val = "PO Report from " + StartValue.ToString() + " to " + EndValue.ToString() + "Vendor All";
List<PdfHeaderFooterContent> HeaderContent = new List<PdfHeaderFooterContent>
{
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = val , Position = new PdfPosition() { X = 0, Y = 50 }, Style = new PdfContentStyle() { TextBrushColor = "#000000", FontSize = 13 } },
new PdfHeaderFooterContent() { Type = ContentType.Text, Value = TextBoxValue, Position = new PdfPosition() { X = 0, Y = 120 }, Style = new PdfContentStyle() { TextBrushColor = "#8B0000", FontSize = 13 } }
};
PdfExportProperties ExportProperties = new PdfExportProperties();
PdfHeader Header = new PdfHeader()
{
FromTop = 0,
Height = 150,
Contents = HeaderContent
};
ExportProperties.Header = Header;
args.PdfExportProperties = ExportProperties;
} |
Good Day Sir Manikandan Murugesan and Syncfusion Team,
Thanks for the reply.. :)
Take Care and God Bless..
Nelson
Good Day Sir Manikandan Murugesan and Syncfusion Team,
I'll try the codes you send to me but still no header appear in my Pivot PDF export..
Please check my save source code to check the problem..
Thanks and God Bless..
Nelson
Gud Day Sir Manikandan Murugesan,
Thanks for reply.. this is the sample of PDF export.. Same files..
Thanks
Nelson
Good Day Syncfusion Team,
How can i Add Date Parameter like this in fig 1 using MySQL Store Procedure like in Fig 2:
Fig 1:
Fig. 2:
Thanks..
Nelson
Good Day Rahul,
Can you give me sample program using Mysql connection..
Thanks
Nelson
Good Day Syncfusion Team,
How can i export in PDF format in Group datagrid?, PDF export not working..
Thanks..
Nelson
Good day to all,
Thanks for the reply..
Nelson
Good Day to all,
How to appear running balance in PDF Export?
Thanks
Nelson
|
<SfGrid ID="Grid" @ref="DefaultGrid" DataSource="@Orders" AllowPaging="true" AllowGrouping="true" Toolbar="@(new List<string>() { "PdfExport" })" AllowPdfExport="true">
<GridGroupSettings Columns="@Initial"></GridGroupSettings>
<GridEvents PdfQueryCellInfoEvent="PdfQueryCellInfoHandler" OnToolbarClick="ToolbarClickHandler" TValue="Order"></GridEvents>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Center" Width="120"></GridColumn>
<GridColumn HeaderText="Customer Name" TextAlign="TextAlign.Center" Width="120">
<Template>
@{
var value = (context as Order);
<div>@value.CustomerID</div>
}
</Template>
</GridColumn>
. . .
</GridColumns>
</SfGrid>
@code{
private SfGrid<Order> DefaultGrid;
public List<Order> Orders { get; set; }
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
{
if (args.Item.Id == "Grid_pdfexport") //Id is combination of Grid's ID and itemname
{
PdfExportProperties ExportProperties = new PdfExportProperties();
ExportProperties.IncludeTemplateColumn = true;
await this.DefaultGrid.PdfExport(ExportProperties);
}
}
public void PdfQueryCellInfoHandler(PdfQueryCellInfoEventArgs<Order> args)
{
if (args.Column.HeaderText == "Customer Name")
{
//Do the content customization of template column value here
args.Cell.Value = args.Data.CustomerID;
}
}
. . .
} |
Good Day to All,
Error appears in CalculateTotal.. please reply for the solution..
Thanks..
Nelson
|
public class Order
{
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public int? ManfCost { get; set; }
public int? LabCost { get; set; }
public int? Result { get; set; }
} |
Good Day Syncfusion Team,
What is the solution for this error? i have 3 RDLC reports.. The 2 Reports are working but this 1 report have error..
Please help me..
Thanks
Nelson
Hi Nelson,
Thanks for the update.
We are quite unclear about the problem currently you are facing. Could you please share the below details which will be helpful to validate and provide a better solution?
Regards,
Rahul
Good Day Syncfusion Team,
My question is it possible to convert blazor server side to PWA?
Thanks in Advance..
Nelson
Hi Nelson,
We checked your query and we sorry to say that it is not possible to convert blazor server side to PWA. Refer the below general link to know more details.
https://stackoverflow.com/questions/69269347/blazor-server-pwa
Please get back to us if you have further queries.
Regards,
Naveen Palanivel
Good Day Naveen Palanivel ,
Thanks for the reply..
My Next question is for EditMode.Dialog, why SfTextBox for ItemCode is not changing when i select Item in
SfDropDownList? Im using ValueChange.. In
EditMode.Batch is working but not in
EditMode.Dialog..
thanks in advance..
Nelson
Hi Nelson,
Sorry for the inconvenience.
We are currently Validating the reported query at our end and we will update the further details within two days(Sept2, 2022). Until then we appreciate your patience.
Regards,
Keerthana
Hello Keerthana ,
Ok thanks.. willing to wait.. :)
Nelson
Hi Nelson,
Sorry for the inconvenience.
We are currently Validating the reported query at our end and we will update the further details within one days(Sept2, 2022). Until then we appreciate your patience.
Regards,
Naveen Palanivel
Good Day Naveen Palanivel ,
Noted.. Thanks.. :)
Nelson
Hi Nelson,
Welcome from Syncfusion support.
Query: ItemCode is not changing when I select Item in
SfDropDownList
We have checked your query and we could not able to reproduce the reported
issue at our end on our version(20.2.0.46). Please upgrade to our latest version
and check whether the reported issue is reproduced at your end.
If the reported issue persists or if we misunderstood your query, then kindly
share the below details to validate further at our end.
The above-requested details will be very helpful for us to
validate the reported query at our end and provide the solution as early as
possible.
Regards,
Keerthana.
Good Day Syncfusion Team,
How can I Add custom button for ADD and EDIT in Adaptive UI Layout in Blazor DataGrid Component (Vertical Mode).
My Codes:
Thanks and God Bless,
Nelson
Hi Nelson
Greetings from Syncfusion support.
We checked your query and you want to Add custom button for ADD and EDIT in Adaptive UI Layout in Vertical Mode. we prepared sample as per the requirement and attached in this ticket .
Please refer the attached sample for your reference .
Please get back to us if you need further assistance
Regards,
Naveen Palanivel
Hi Naveen Palanivel,
Thanks for quick reply.. still not appear Add and Edit button in grid.. my Syncfusion Blazor version is 19.3.0.44.. can't update the version because it possible to have bugs in my program..
Thanks and God Bless
Nelson
Hi Nelson,
We checked your query and we would like to inform that custom button for ADD and EDIT in Adaptive UI Layout in Vertical Mode is work well in latest version . we also shared sample in pervious response. We see your query you are using old version(19.3.0.44)After that we given many main release so please kindly update the package to the latest version.
If, you still facing that issue please get back to us
Regards,
Naveen Palanivel
Hello Naveen Palanivel ,
Thanks for reply.. my another question is how to fix number with negative sign to be place to left and
SfNumericTextBox label to be place in right like in SfComboBox?
My Next question is why Delete button not working in grid detail?
my code for delete:
Thanks in Advance
Hi Nelson,
Query1:” Delete button not working in grid detail”
We checked your query and we would like to inform that please ensure Isprimary is set to the any one of the column. While preforming the CURD operation, to enabled IsPrimarykey column to an unique column and that column will not able to edit. We also see in action begin event you are using customized method inside the request type. We also given UG documentation link below for more information
Reference : https://blazor.syncfusion.com/documentation/datagrid/editing#event-trace-while-editing
If the reported issue is still persist then kindly share the below details to validate further at our end.
The above-requested details will be helpful for us to validate the reported query at our end and provide the solution as early as possible.
Qyery 2 : “SfNumericTextBox label to be place in right like in SfComboBox”
Currently we are validating your query at our end and we will update further details within two business days on or before 30th September 2022.
Please let us know if you have any concerns.
Regards,
Naveen Palanivel
Hi Naveen Palanivel,
Thanks for the reply.. My next question is please can you fix to move negative sign to the left ? please check my screenshot:
Thanks
Nelson
Hi Nelson,
Sorry for the inconvenience.
We are currently Validating the reported query at our end and we will update the further details within one days(Oct 4, 2022). Until then we appreciate your patience.
Regards,
Naveen Palanivel
Hi Nelson,
We have checked your query and before proceeding further with your requirement kindly share the below details to validate further at our end.
The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.
Regards,
Naveen Palanivel
Hi Neslon,
Currently we are checking the reported query at our end. We will update further details on or before 21 September 2022.
Until then we appreciate your patience.
Regards,
Naveen Palanivel