I have three major issues I want to be addressed which are...
(1) Printing without overlapping on the second page using Sfdatagrid. (screen shot of lapping.jpg)
(2) Printing Sfdatagrid with coloured background styling. (sample screen shot.jpg)
(3) Printing to accommodate more rows as done in the (custom,1 & 2 screenshot) or the mp4 file. Because my printing can only accommodate only 14 rows as we speak. so I'm thinking of using reduced custom rows but there again this is a print thing or i increase the bottom border using the preview print as i did in the HTML version. Please help on this as i don't know how to accommodate more rows.
Hi Leke ,
We are validating your reported issue. We will update you with proper details on January 17, 2022.
Regards,
Sampath Narayanan.S
Hi Leke,
We have checked the details provided and we need following details from you to analyze this further.
Regards,
Sampath Narayanan.S
1) Was trying to print from the print dialogue screen there is no print preview anywhere
Here is the code used for printing that I need to accommodate more rows when I print on landscape A4. I also attached the whole cs code just in case you want to edit it manually.
private void PrintToolStripMenuItem_Click(object sender, EventArgs e)
{
if (sfDataGrid1.RowCount > 0)
{
var options = new PdfExportingOptions();
var document = new PdfDocument();
document.PageSettings.Orientation = PdfPageOrientation.Landscape;
options.AutoColumnWidth = true;
options.AutoRowHeight = true;
options.ExportFormat = true;
options.ExportGroups = true;
options.RepeatHeaders = false;
options.FitAllColumnsInOnePage = true;
options.ExportMergedCells = true;
options.ExportFormat = true;
options.ExportAllDetails = true;
options.CellExporting += options_CellExporting;
options.HeaderFooterExporting += options_HeaderFooterExporting;
var page = document.Pages.Add();
PdfGrid pdfGrid = new PdfGrid();
PdfGridLayoutResult result = pdfGrid.Draw(page, PointF.Empty);
My issue now is how do I Shrink or accommodate more rows? Like I showed you in the video. It is either I do it via print-preview so that I can adjust the borders or I set it to accommodate more rows. Print preview is not the issue. I want to print between 20-25 rows per landscape page on A4 paper.
Thanks
Hi Leke,
We are checking the possibilities to achieve the requirement of yours. We will check and update you with more details on March 2, 2022.
Regards,
Sampath Narayanan.S
Hi Leke,
We have checked with our internal PdfViewer team and the respective team updated that it is not possible to achieve page break for particular row range while exporting to pdf document. We can only paginate the entire Pdf Grid based on the current page size and grid bounds, then the layout format will paginate the grid content. For customer requirement, we could not page break the row range in our Grid rendering approach.
Please let us know if you need any further assistance in this.
Regards,
Sampath Narayanan.S
The only thing I want done is to accommodate more rows on a page and the whole syncfusion team can’t achieve that? Wow! This is so sad after I have wasted money on a developer to get grid issue on winforms sorted out for merging cells. Now we are facing this again? Imagine I had paid for main license and not using community license would you be tell me this ? This is very sad.
1) I already confirmed that I want to print more grid on a page when exporting to pdf. Which is why we are here. So asking this question is like you don’t know what I want to achieve.
2) I’m drawing a multiple grid which I was able to achieve. 2 different grid.
3) this I have provided from the first message I sent to you guys. Are you just asking me this questions to waste more of my time ?
4) the video attachment can be played with vlc player. So you guys didn’t look at it all this while. Wow! If you had done this since you would have wasted weeks for me. VLC PLAYER to play the video please.
Thanks
Tried the code it didn't work, I'm guessing some of these codes are for WPF, not WinForms. So what next should we do cause this is draining. This is over 4 months just on printing.
Are you referring to the solution of auto adjusting all the grid borders to zero? That is the one I tried that didn’t work. Can we try something else like reducing row height? I also tried reducing grid font size to 4.0f still same issue.
is this the code you are referring to in BOLD? I am not a developer and my developer got frustrated doing this after charging for the number of weeks I wasted his time. You have the code already to this cs file with you already. why not look through and see where things are done wrongly and correct it then I would replace it at my end.
The best i can do is where i put it below.
Thanks.
private void options_CellExporting(object sender, DataGridCellPdfExportingEventArgs e)
{
if (e.CellType != ExportCellType.RecordCell)
return;
PdfStringFormat format = new PdfStringFormat();
//format the string from right to left.
format.TextDirection = PdfTextDirection.LeftToRight;
format.LineAlignment = PdfVerticalAlignment.Middle;
format.Alignment = PdfTextAlignment.Center;
e.PdfGridCell.StringFormat = format;
e.PdfGridCell.Style.CellPadding = new PdfPaddings(0, 0, 0, 0);
}
Wow, I had such problem and this code helped me to solve it in my project for depositphotos . TNX everyone in this forum!
What did you do differently cause it didnt work for me...
Let me know, you can add images for me to see the issues.