We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Print the contents of the spreadsheet

Hello.
I want to use the control "spreadsheet" to display the contents of the XL-document. I tried to use https://www.syncfusion.com/kb/3028/how-to-print-the-worksheets-in-spreadsheet , but failed because "spreadSheetControl" for missing property "GridProperties".
How can I display the icon "Print" on "SfSpreadsheetRibbon" and use it?

16 Replies

KB Kanimozhi Bharathi Syncfusion Team October 16, 2015 11:57 AM UTC

Hi Berezkin Gena,

Thank you for contacting Syncfusion Support.

Please find the details below,


QUERY
RESPONSE
I want to use the control "spreadsheet" to display the contents of the XL-document. I tried to use https://www.syncfusion.com/kb/3028/how-to-print-the-worksheets-in-spreadsheet , but failed because "spreadSheetControl" for missing property "GridProperties".
This KB is related to SpreadsheetControl(Classic) not to SfSpreadsheet.

For Printing in SfSpreadsheet, you can find the samples in the Dashboard in the following link

Link: Syncfusion Dashboard->WPF->Run Local Samples->Grids->Spreadsheet ->Miscellaneous->Printing

How can I display the icon "Print" on "SfSpreadsheetRibbon" and use it?

We have prepared a sample based on your requirement. A Ribbon Tab “Other” has been created and the options “Print and PrintPreview” has been loaded as Ribbon buttons in the tab. Please find the sample from the below link,

Sample:http://www.syncfusion.com/downloads/support/forum/120797/ze/CS-524624951



Please let us know if you have any query.

Regards,

Kanimozhi B



BG Berezkin Gena October 16, 2015 01:29 PM UTC

Hi, Kanimozhi Bharathi.

Thank you.

I have v13.2.0.34 for Syncfusion Dashboard. But my Miscellaneous contain only two item:
-exporting
-localization

What version I need to install to your specified item appearing?


PS Pannir Selvam S Syncfusion Team October 16, 2015 02:10 PM UTC

Hi Berezkin,

The Printing sample for SfSpreadsheet is included from the Essential Studio 2015 Volume 3  v13.3.0.7 and is available for download under the following link.

https://www.syncfusion.com/forums/120659/essential-studio-2015-volume-3-final-release-v13-3-0-7-is-available-for-download

Regards,
Pannir


BG Berezkin Gena October 19, 2015 09:30 AM UTC

Hello.

Thanks for the help.

There are a few questions that came to me when studying your example.
1. I am trying to configure page pdf document (PdfDoc.PageSettings) before it is loaded into PdfViewer. However, the line:
            pdfDoc.PageSettings.Orientation = PdfPageOrientation.Landscape;
            pdfDoc.PageSettings.Size = PdfPageSize.A4;
have no effect. So I do not understand how to set margins for printing.
2. There is no binding between the print dialog and pdfViewer. What I had not set up in the print dialog is not displayed in PrintPreviewWindow. How can I bind these settings in the print dialog to pdfDoc.PageSettings? I tried to use http://help.syncfusion.com/wpf/pdfviewer/printing-pdf-files to access the PrintDialog but I did not. The class is instantiated PrintDialog there are no properties AllowPrintToFile and Document.


KB Kanimozhi Bharathi Syncfusion Team October 21, 2015 01:01 PM UTC

Hi Berezkin,

Please find the details below,


I am trying to configure page pdf document (PdfDoc.PageSettings) before it is loaded into PdfViewer. However, the line:
            pdfDoc.PageSettings.Orientation = PdfPageOrientation.Landscape;
            pdfDoc.PageSettings.Size = PdfPageSize.A4;
have no effect. So I do not understand how to set margins for printing.
We are able to reproduce the issue and this issue will be fixed in the upcoming release 2015 Vol 4
There is no binding between the print dialog and pdfViewer. What I had not set up in the print dialog is not displayed in PrintPreviewWindow. How can I bind these settings in the print dialog to pdfDoc.PageSettings? 
On loading the document with above page settings in PdfViewerControl and printing the same will print the document as expected.
 I tried to use http://help.syncfusion.com/wpf/pdfviewer/printing-pdf-files to access the PrintDialog but I did not. The class is instantiated PrintDialog there are no properties AllowPrintToFile and Document.
The Properties AllowPrintToFile and Document are the properties of 
System.Windows.Forms.PrintDialog. These properties are not available with
System.Windows.Controls.PrintDialog.

To silent print the loaded document in PdfViewerControl WPF, please use the Print() API as in below code snippet.

pdfviewer1.Print();
 
Regards,
Kanimozhi B



BG Berezkin Gena October 21, 2015 02:12 PM UTC

How long do I have to wait for the release?
I draw your attention that when you configure the print is very important to control the margins on the page.


KB Kanimozhi Bharathi Syncfusion Team October 22, 2015 09:56 AM UTC

Hi Berezkin,

Please find the details below,


I am trying to configure page pdf document (PdfDoc.PageSettings) before it is loaded into PdfViewer. I do not understand how to set margins for printing.

The Exception issue we mentioned in the previous update arises only due to the complex formula calculations in the attached excel sheet of Printing Demo. The PageSetup configuration for PDF document will normally work with any other excel files. Hence you can set the orientation, size and margin to the current worksheet of Spreadsheet for printing like the following Code example,

Spreadsheet.ActiveSheet.PageSetup.Orientation = ExcelPageOrientation.Landscape;

Spreadsheet.ActiveSheet.PageSetup.PaperSize = ExcelPaperSize.PaperA4;
Spreadsheet.ActiveSheet.PageSetup.TopMargin = 5;


We have also prepared a sample based on your requirement. Please find the link below,

Link: http://www.syncfusion.com/downloads/support/forum/120797/ze/CS_(2)517018588

Note: 2015 Vol4 release will be in the mid of December,2015.

Please let us know if you have any query.

Thanks
Kanimozhi B



BG Berezkin Gena October 28, 2015 11:53 AM UTC

Hello!
Pdfviewer displays the data is not the same as the data displayed in spreadsheet. I have attached a file that will reproduce the error.
What settings do I need to do to get around this?

Attachment: SpreadsheetBag_74f46de7.zip


KB Kanimozhi Bharathi Syncfusion Team October 29, 2015 12:06 PM UTC

Hi Berezkin,

We have analyzed and tested your reported issue, but we are unable to reproduce the issue with our sample. From the screenshot, we suspect that you must have clicked the “Print Preview” Option in Spreadsheet while the cell is in Edit mode. We suggest you to apply the wrap text for that particular cell to view in Pdf Viewer.

Please find the sample link below for your reference,

Sample: http://www.syncfusion.com/downloads/support/forum/120797/ze/CS_(2)-1443535155

Regards,
Kanimozhi B


BG Berezkin Gena October 29, 2015 01:19 PM UTC

Hi, Kanimozhi Bharathi.

I changed the Excel template file so that you can reproduce the bug.

Attachment: CS_f165c140.zip


KB Kanimozhi Bharathi Syncfusion Team October 30, 2015 12:39 PM UTC

Hi Berezkin,

We are able to reproduce the issue and this issue will be fixed in the upcoming release 2015 Vol 4 which will be in the mid of December, 2015.

Regards,
Kanimozhi B


BG Berezkin Gena February 16, 2016 12:29 PM UTC

I have uploaded a new version of the ES (13.4.0.53). I can see a marked improvement in the PDF converter. But I can not remove the right and left indentation in the resulting PDF file. Excel document that is printed without problems in Excel is absolutely not suitable for print PDF converter. I tried to use an object of class PdfDocument, but PageSettings.Margins property does not respond to the value.


TL Thirumurugan Loganathan Syncfusion Team February 18, 2016 06:09 PM UTC

Hi Berezkin,

 

 We have checked your query from our side and you can remove right and left indentation in the Pdf document by set the margin to the current worksheet of Spreadsheet. Please refer the following Code example,

 

Spreadsheet.ActiveSheet.PageSetup.LeftMargin = 0;
            
Spreadsheet.ActiveSheet.PageSetup.RightMargin = 0; 


We have also prepared a sample based on your requirement. Please find the below sample link.



Sample :http://www.syncfusion.com/downloads/support/directtrac/general/ze/Margin_setting-287548568  

 

Regards,

Thirumurugan



BG Berezkin Gena February 24, 2016 02:19 PM UTC

Hello, Syncfusion Support!

"PageSetup" can not be changed. All settings of this property are made in MS Excel. I'm trying to get the same results when printing in "Excel" and "Spreadsheet". Your test file "Testing Purpose.xlsx"(Margin_setting-287548568) is very well suited to be convinced in the existence of a problem.

P.S. This is not a problem for me personally, but a text editor on your forum defines the word "Syncfusion" as it is written with an error.


KB Kanimozhi Bharathi Syncfusion Team February 26, 2016 03:59 AM UTC

Hi Berezkin,
We have forwarded your query internally to our development team. We will update you the details at the earliest.
Regards
Kanimozhi B


KB Kanimozhi Bharathi Syncfusion Team February 26, 2016 10:33 AM UTC

Hi Berezkin,

Please find the details below,


QUERY
RESPONSE
PageSetup" cannot be changed. All settings of this property are made in MS Excel. I'm trying to get the same results when printing in "Excel" and "Spreadsheet". Your test file "Testing Purpose.xlsx"(Margin_setting-287548568) is very well suited to be convinced in the existence of a problem.
We are able to reproduce the printing issue and this issue will be fixed in the upcoming release 2016 Vol which will be rolled out at the end of March.
 
This is not a problem for me personally, but a text editor on your forum defines the word "Syncfusion" as it is written with an error.
Thank you for bringing this information to our attention.

We will look for ways to resolve this problem, so that this will not happen in the future
 
Regards,
Kanimozhi B


Loader.
Live Chat Icon For mobile
Up arrow icon