PRINTING ISSUES

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.




Attachment: print_issues_c24d09ab.rar

19 Replies

SS Sampathnarayanan Sankaralingam Syncfusion Team January 12, 2022 02:03 PM UTC

Hi Leke , 


We are validating your reported issue. We will update you with proper details on January 17, 2022. 


Regards, 

Sampath Narayanan.S 



SS Sampathnarayanan Sankaralingam Syncfusion Team January 17, 2022 01:57 PM UTC

Hi Leke,


We have checked the details provided and we need following details from you to analyze this further.


  1. Are you trying to print the grid directly from PrintPreview or after exporting the DataGrid to pdf?
  2. Can you please provide the simple sample which will be help us to replicate your issue and also to find the exact cause for issue and to provide the prompt and timely solution.


Regards,

Sampath Narayanan.S



LS Leke Salami February 24, 2022 05:13 PM UTC

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);


Attachment: calculatesummarysheet_88886288.rar


SS Sampathnarayanan Sankaralingam Syncfusion Team February 25, 2022 02:20 PM UTC

  
Hi Leke, 

Currently SfDataGrid don’t have printing (also print preview) option in SfDataGrid. But we have a work around to achieve your requirement by using Pdf exporting support and PrintPreviewDialog. Please find  the below UG for more reference. 


Regards, 
Sampath Narayanan.S 



LS Leke Salami February 26, 2022 02:43 AM UTC

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  



SS Sampathnarayanan Sankaralingam Syncfusion Team February 28, 2022 09:49 PM UTC

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



SS Sampathnarayanan Sankaralingam Syncfusion Team March 2, 2022 07:21 PM UTC

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



LS Leke Salami March 2, 2022 07:27 PM UTC

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. 



SS Sampathnarayanan Sankaralingam Syncfusion Team March 3, 2022 03:12 PM UTC

Hi Leke, 
Sorry for the inconvenienced caused.

 
Could you please share the below requested details to analyze your requirement, 

  • Confirm us whether you want to render more grid rows in a single page while exporting to pdf ?
  • And also confirm us whether you are drawing single grid or multiple grid?
  • Please provide the simple sample to replicate the issue and also provide the output document. It will be more helpful for provide you the solution with prompt and timely solution.
  • In video attachment, it does not shown anything and show black page. Please share the video once again to understand the exact requirement. And also provide the expected output screenshot.

Regards, 
Sampath Narayanan.S 



LS Leke Salami March 4, 2022 03:55 AM UTC

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 



SP Sangavi Periyannan Syncfusion Team March 4, 2022 05:54 PM UTC

Hi Leke,

Sorry for the inconvenience.

We can understand your frustration. Since your query is related to the grid and PDF controls, it needs to be discussed with our internal team. As a result, we requested more details to clarify your requirements and proceed further. Now we have created a new ticket under your account. Please check and have a further follow-up related to this forum on a new ticket. Also, we have considered your reported query as high priority and our team will work for your satisfaction.

Regards,
Sangavi




LS Leke Salami March 22, 2022 05:14 PM UTC

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. 



MA Mohanram Anbukkarasu Syncfusion Team March 23, 2022 02:06 PM UTC

Hi Leke, 

We regret for the inconvenience.  

We have provided the solution in the ticket that we have created under your account. Please check and revert with more details about the problem in the solution in the ticket. Please check and have further follow-up in the ticket. 

Regards, 
Mohanram A. 



LS Leke Salami March 23, 2022 06:11 PM UTC

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.



MA Mohanram Anbukkarasu Syncfusion Team March 24, 2022 01:27 PM UTC

Hi Leke, 

Kindly try the solution we have provided in the ticket to reduce the cell padding to 0 using CellExporting event. This will make the height of the rows to fit its content. So number rows in a page will be increased. Please revert to us with details in the ticket to have hassle free follow ups, if the solution doesn’t works for you.  

Regards, 
Mohanram A. 



LS Leke Salami March 25, 2022 12:07 PM UTC

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);

        }



MA Mohanram Anbukkarasu Syncfusion Team March 28, 2022 01:20 PM UTC

Hi Leke, 
 
We regret for the inconvenience. We hope that setting CellPadding helps to meet your requirement. Please let us know if you require any other assistance from us.  
 
Regards, 
Mohanram A. 



RD Roman Dud replied to Leke Salami April 18, 2022 04:56 PM UTC

Wow, I had such problem and this code helped me to solve it in my project for depositphotos . TNX everyone in this forum!



LS Leke Salami replied to Roman Dud April 25, 2022 04:34 PM UTC

What did you do differently cause it didnt work for me...


Let me know, you can add images for me to see the issues.


Loader.
Up arrow icon