BoldDesk®Customer service software offering ticketing, live chat, and omnichannel support, starting at $49/mo. for 10 agents. Try it for free.
I need to write PDF with table. were each record must written in same page. Each record have two lines. one with two column with fix height, and second with one column wrapping text as it long . like:
The above record must not split over pages.
So I create Parent table called grd1. each row is nested Child table with two rows called grd2. grd2 had two rows. The first one contain grd3_1 with two column. and grd3_2 had one column.
Grd1 declare as: AllowRowBreakAcrossPages = false
The result is buggy. Starting page 2, the table grd2_2 print only one line of text:
Here is the code:
static PdfDocument pdfExmpl5()
{
PdfDocument document = new PdfDocument();
PdfPage page = document.Pages.Add();
PdfGraphics graphics = page.Graphics;
RectangleF r = new RectangleF(0, 0, page.GetClientSize().Width, 50);
PdfPageTemplateElement header = new PdfPageTemplateElement(r);
header.Graphics.DrawRectangle(PdfBrushes.Pink, r);
document.Template.Top = header;
PdfPageTemplateElement footer = new PdfPageTemplateElement(r);
PdfFont font2 = new PdfStandardFont(PdfFontFamily.Helvetica, 7);
PdfPageNumberField pageNumber = new PdfPageNumberField(font2, PdfBrushes.Black);
PdfPageCountField count = new PdfPageCountField(font2, PdfBrushes.Black);
PdfCompositeField compositeField = new PdfCompositeField(font2, PdfBrushes.Black, "Page {0} of {1}", pageNumber, count);
compositeField.Bounds = footer.Bounds;
compositeField.Draw(footer.Graphics, new PointF(470, 40));
document.Template.Bottom = footer;
PdfGrid grd = new PdfGrid();
grd.Columns.Add(1);
grd.Headers.Add(1);
grd.Headers[0].Cells[0].Value = "Header";
for (int i = 0; i < 40; i++)
{
PdfGrid grd3_1 = new PdfGrid(); grd3_1.Columns.Add(2); grd3_1.Rows.Add(); grd3_1.Rows[0].Cells[0].Value = "grd3_1"; grd3_1.Rows[0].Cells[1].Value = "1111";
PdfGrid grd3_2 = new PdfGrid(); grd3_2.Columns.Add(1); grd3_2.Rows.Add(); grd3_2.Rows[0].Cells[0].Value = "grd3_2 - Scanning to pdf on Windows 10 is an easy process with the right tools. Whether you use built-in software, download a free scanning program, or use an online scanner, you can quickly and easily create high-quality pdf files from your physical documents. For those who want a comprehensive and versatile solution for working with pdfs, we recommend downloading WPS Office, which offers a full suite of tools for editing, converting, and managing pdf files. With its intuitive interface and powerful features, WPS Office is a top choice for users who want to streamline their pdf workflow. Download WPS Office today and see how it can improve your pdf experience.";
PdfGrid grd2 = new PdfGrid();
grd2.Columns.Add(1);
grd2.Rows.Add(); grd2.Rows[0].Cells[0].Value = grd3_1;
grd2.Rows.Add(); grd2.Rows[1].Cells[0].Value = grd3_2;
//grd2.AllowRowBreakAcrossPages = false;
//grd3_1.AllowRowBreakAcrossPages = false;
//grd3_2.AllowRowBreakAcrossPages = false;
grd.Rows.Add();
grd.Rows[i].Cells[0].Value = grd2;
}
grd.AllowRowBreakAcrossPages = false;
grd.RepeatHeader = true;
PdfLayoutResult result;
result = grd.Draw(page, new RectangleF(0, 100, 400, 700));
return document;
}
Hi Matanya,
We were able to reproduce the reported issue with the provided details on our end, and currently, we are analyzing it. We will provide further details on July 18, 2024.
Regards,
Jeyalakshmi T
Currently we are still analyzing on your requirement, and we will update further details on July 22nd , 2024.
Hi Matanya,
We have confirmed the issue “Text is not proper while drawing the Pdf Grid with nested grid table ” as a defect in our product and we will include the fix into our upcoming weekly NuGet release on August 6th , 2024.
Please use the below feedback link to track the status of the reported bug.
Note: If you require a patch for the reported issue in any of our Essential Studio Main or SP release versions, then kindly let us know the version, so that we can provide a patch in that version based on our SLA policy.
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
Regards,
Aribalakrishnan G.
Hi Matanya,
We were unable to include the fix for the issue " Text is not proper while drawing the Pdf Grid with inner table 2 levels " as promised in the weekly release scheduled to be published tomorrow (6/08/2024). This fix will be included in the next weekly release (13/08/2024).
If you would like to verify the fix before the next release, we can provide you with a custom patch. Please let us know if you are interested.
We apologize for any inconvenience this may have caused and appreciate your understanding.
Regards,
Jeyalakshmi T
Hi Matanya,
Sorry for the inconvenience caused. We were unable to include the fix for the issue “Text is not proper while drawing the Pdf Grid with inner table 2 levels” in the promised weekly release due to stability concerns. This fix will be included in the next weekly release, scheduled for August 20, 2024.
Regards,
Moorthy K
Hi Matanya,
We are unable to include this fix in latest weekly release. We have created custom NuGet for this fix in mentioned version (26.2.10.0). We will include the fix into our upcoming weekly NuGet release which will be available on August 27th, 2024 without fail. Please find the custom NuGet package on the below link.
Custom NuGet :
Please find the below link for clear the NuGet cache,
https://support.syncfusion.com/kb/article/6265/how-to-clear-nuget-cache
Root cause :
We encountered an issue with drawing the grid when the parent grid contains multiple child grids. The height and width must be calculated based on the values from the child grids. After pagination, we calculated the width based on the column width. However, the column width exceeds the width of the parent grid, which is causing the problem.
Regards,
Jeyalakshmi T
Hi Matanya,
We have included the fix for this issue " Text is not proper while drawing the Pdf Grid with nested grid table" in our latest weekly release (26.2.11).Please download the NuGet from the below link,
NuGet Link: https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/26.2.11
Root Cause : We encountered an issue with drawing the grid when the parent grid contains multiple child grids. The height and width must be calculated based on the values from the child grids. After pagination, we calculated the width based on the column width. However, the column width exceeds the width of the parent grid, which is causing the problem.
Regards,
Aribalakrishnan G.
Regards,