Printing is not clear enough

Good day,

I have tested printing a spreadsheet in the spreadsheet control (via PdfConverter as shown in the online documentation) and then opened the spreadsheet in Excel and printed from there for comparison.

Printing from the spreadsheet control looks good for the data and formatting in the cells, but charts do not look very good. They look as if the charts are being saved as bitmap images before being printed, and so they lose a great deal of their quality. Excel prints them far better and with very high quality.

Is there a more direct way to print from the spreadsheet control where it perhaps draws itself to the printer and skips the pdf converter, or perhaps another way to retain the high resolution needed, like Excel does?

Also, is there a way to set the PrintArea of the document in the spreadsheet control? Is there support for PageBreak View?

Thank you for your help! 

5 Replies

TL Thirumurugan Loganathan Syncfusion Team December 6, 2017 10:06 AM UTC

Hi Travis,   
   
Please find the below details,   
   
S.No   
Query   
Comments   
1   
Chart clarity is missing while printing sheet from the spreadsheet control.   
This issue can be resolved by setting the ScalingMode property of the workbook as in the below code sample.   
   
   
workbook.Application.ChartToImageConverter.ScalingMode =ScalingMode.Best;   
   
   
   
Note: In the spreadsheet control, chart is rendered as image when converting the excel to PDF file using ExcelToPDFConverter of the XlsIO. But in MS-Excel, chart is directly rendered, so clarity will be missing only after zooming. In normal view, chart clarity will be good.   
   
2   
PrintArea support in the spreadsheet   
You can achieve this support by setting the PrintArea property of the workbook. This should be set before converting the excel to PDF document as in the below code sample.   
   
   
MemoryStream pdfstream = new MemoryStream();   
   
workbook.Application.ChartToImageConverter.ScalingMode =ScalingMode.Best;   
   
workbook.ActiveSheet.PageSetup.PrintArea = "A1:G6";   
   
ExcelToPdfConverter converter = new ExcelToPdfConverter(workbook);   
   
   
   
3   
PageBreak view support in the spreadsheet   
Currently spreadsheet control does not have support for PageBreak view.    
   
   
   
Please let me know if you have any other concern.   
   
Regards,   
Thirumurugan   




TC Travis Chambers December 7, 2017 04:29 AM UTC

Thank you so much for your help!

I haven't had a chance to test the printing yet, but I can tell from looking at the pdf document that the quality has indeed gotten better. Also, thank you for the print area info, that works great.

If I may ask another questions about the charts in the pdf, is there a way to add a chart to one tab loaded with the range from another tab? The addchart() method does not seem to recognize the IWorksheet put in it. No matter which sheet I attempt to assign it to the chart always appears in the current activesheet. So, I attempted to assign the selected sheet as the activesheet before adding the chart, which does add the chart to the appropriate tab within the spreadsheet, but then when I convert to pdf the chart appears on the original tab that holds the datarange, not the tab I assigned it to.

Thanks!


TL Thirumurugan Loganathan Syncfusion Team January 15, 2018 12:56 PM UTC

Hi Travis, 
 
We could able to reproduce the issue “Chart always added in active sheet when add chart in another sheet ”. Hence we have logged a defect report on the issue and we will update you the patch file on or before { 26 January, 2018 }. 
 
Regards, 
Thirumurugan 



TL Thirumurugan Loganathan Syncfusion Team January 17, 2018 05:38 AM UTC

Hi Travis, 
 
We could able to reproduce the issue “Chart always added in active sheet when add chart in another sheet”. Hence we considered to fix the issue and it will up available in upcoming release. If you need patch for the issue please confirm us whether we need to create separate incident for the issue. 
 
Regards, 
Thirumurugan 



TL Thirumurugan Loganathan Syncfusion Team January 17, 2018 09:17 AM UTC

Hi Travis, 
 
Sorry for the inconvenience. Please ignore previous update. 
 
You can overcome the issue “Chart always added in active sheet only when add chart in another sheet” by setting the active sheet using SetActiveSheet method and then add the chart by using AddChart method as in the below code sample. 
 
 
var series = spreadsheet.ActiveSheet.Charts[0].Series; 
var activeSheet = spreadsheet.Workbook.Worksheets[1]; 
spreadsheet.SetActiveSheet(activeSheet.Name); 
var chart = spreadsheet.AddChart(spreadsheet.ActiveSheet); 
chart.Series.Add(series[0]); 
chart.Series.Add(series[1]); 
 
(chart as ShapeImpl).Top = 100; 
(chart as ShapeImpl).Left = 100; 
 
spreadsheet.ActiveGrid.GraphicModel.InvalidateGraphicObjects(); 
spreadsheet.ActiveGrid.GraphicModel.InvalidateGraphicVisual(); 
 
 
 
Regards, 
Thirumurugan 


Loader.
Up arrow icon