How can I not display the left border and right border? Referring to the code I have below, using border will display top, left, bottom and right border. But I just want the top and bottom to be in black. Any advise? Thank you in advance
Hi Yareesha,
We are validating this query with our internal grid team and will provide further details within two business days (June 30, 2022).
Regards,
Angelin Faith Sheeba.
Hi Angelin,
Thank you so much for your reply. Sure, ill wait.
Thank you,
Yareesha
Hi Yareesha,
We are validating this query with our internal PDF team and will provide further details within two business days (July 4, 2022).
Regards,
Angelin Faith Sheeba.
Hi Angelin,
Will be waiting for your reply. Thank you.
Regards,
Yareesha.
Hi Yareesha,
Using pdfQueryCellInfo event, you can customize the borders of the pdf cells. Please refer the below code example:
Note: To set transparent color for right and left borders of cells, we have to set the same settings to its adjacent cells too. Four sides of cell borders are drawn with the flow of left, top, right and bottom respectively. Our actual behavior is “next cell left border is overlapped by current cell right border, and current cell left border is overlapped by before cell right border”.
Code Example:
|
pdfQueryCellInfo(args) { if ( args.column.index !== 0 && args.column.index !== args.cell.row.cells.cells.length + 2 //here, we add +2 because we have only 2 members in columns. If we have 3 members add +3 ans so on. ) { //Border color let color: PdfColor = new PdfColor(255, 255, 255); let color1: PdfColor = new PdfColor(224, 224, 224); //Transparent border pen let pen: PdfPen = new PdfPen(color, 0); //grey border color let pen1: PdfPen = new PdfPen(color1, 1);
let borders: PdfBorders = new PdfBorders(); //Set tranparent border for adjacent cell right border of the cell which is located before the target cell. borders.right = pen; borders.left = pen; borders.top = pen1; borders.bottom = pen1; args.cell.style.borders = borders; } else if (args.column.index == args.cell.row.cells.cells.length + 2) { let color: PdfColor = new PdfColor(255, 255, 255); let color1: PdfColor = new PdfColor(224, 224, 224);
let pen: PdfPen = new PdfPen(color, 0); let pen1: PdfPen = new PdfPen(color1, 1);
let borders: PdfBorders = new PdfBorders();
borders.right = pen1; borders.left = pen; borders.top = pen1; borders.bottom = pen1; args.cell.style.borders = borders; } } |
Meanwhile, we have prepared a sample for your reference.
Sample: https://stackblitz.com/edit/angular-vcmuqh?file=app.component.ts
Please see the below UG document for more information on the "pdfQueryCellInfo" event.
Document: https://ej2.syncfusion.com/angular/documentation/pivotview/pdf-export/#pdfquerycellinfo
Please let us know if you have any concerns.
Regards,
Angelin Faith Sheeba.