RadRichTextEditor prints the code as follows:
RadPrintDocument document = new RadPrintDocument();
document.PrintPage += (s, e) => { action?.Invoke(); };
richTextEditor.PrintPreview(document);
Does RadSpreadsheet have such a Print/PrintPreview method?
3 Answers, 1 is accepted
0
Hello,
RadSpreadSheet have both the Print and PrintPreview methods. You can check the following documentation article: https://docs.telerik.com/devtools/winforms/spreadsheet/features/printing.
Let me know if have other questions.
Regards,
Hristo
Progress Telerik
RadSpreadSheet have both the Print and PrintPreview methods. You can check the following documentation article: https://docs.telerik.com/devtools/winforms/spreadsheet/features/printing.
Let me know if have other questions.
Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
zhijun
Top achievements
Rank 1
answered on 03 Apr 2018, 01:04 PM
I want the Print/PrintPreview method to pass a RadPrintDocument object that records whether the user printed the document.
0
Hello,
Thank you for writing back.
Printing in the spread control is handled slightly different compared to how printing is implemented our other controls. Actually, RadSpreadSheet is also working with RadPrintDocument objects, however, these objects are created dynamically and they are not exposed publically. I have logged a feature request in our feedback portal, here: ADD. RadSpreadsheet - expose an API notifying that a print or print preview job is underway. I have also updated your Telerik points. We will do our best to fix the issue in the R2 2018 release.
For the time being, you can use the workaround below handling the PrintPreview method:
I hope this helps. Let me know if you need further assistance.
Regards,
Hristo
Progress Telerik
Thank you for writing back.
Printing in the spread control is handled slightly different compared to how printing is implemented our other controls. Actually, RadSpreadSheet is also working with RadPrintDocument objects, however, these objects are created dynamically and they are not exposed publically. I have logged a feature request in our feedback portal, here: ADD. RadSpreadsheet - expose an API notifying that a print or print preview job is underway. I have also updated your Telerik points. We will do our best to fix the issue in the R2 2018 release.
For the time being, you can use the workaround below handling the PrintPreview method:
private
void
button1_Click(
object
sender, EventArgs e)
{
RadPrintDocument printDocument =
new
RadPrintDocument();
IPrintable printManager =
typeof
(RadSpreadsheetElement).GetProperty(
"PrintManager"
, BindingFlags.Instance | BindingFlags.NonPublic).GetValue(
this
.radSpreadsheet1.SpreadsheetElement)
as
IPrintable;
printDocument.AssociatedObject = printManager;
printDocument.BeginPrint += PrintDocument_BeginPrint;
printDocument.PrintPage += PrintDocument_PrintPage;
printDocument.EndPrint += PrintDocument_EndPrint;
printDocument.QueryPageSettings += PrintDocument_QueryPageSettings;
SpreadsheetPrintPreviewDialog printPreviewDialog =
new
SpreadsheetPrintPreviewDialog(printDocument);
printPreviewDialog.ThemeName =
this
.radSpreadsheet1.ThemeName;
printPreviewDialog.ShowDialog();
}
private
void
PrintDocument_QueryPageSettings(
object
sender, System.Drawing.Printing.QueryPageSettingsEventArgs e)
{
}
private
void
PrintDocument_EndPrint(
object
sender, System.Drawing.Printing.PrintEventArgs e)
{
}
private
void
PrintDocument_BeginPrint(
object
sender, System.Drawing.Printing.PrintEventArgs e)
{
}
private
void
PrintDocument_PrintPage(
object
sender, System.Drawing.Printing.PrintPageEventArgs e)
{
}
I hope this helps. Let me know if you need further assistance.
Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.