This is a migrated thread and some comments may be shown as answers.

How to print a week view

3 Answers 85 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Art
Top achievements
Rank 1
Art asked on 12 Mar 2013, 06:26 PM
I'd like to print a week view as it appears in the application, i.e. days across the top, time slots along the side, and appointments sized and placed in those slots. I'd like it in landscape mode. Seems like it should be simple but I can't figure it out.

Later
Art

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Mar 2013, 02:05 PM
Hello Art,

Thank you for writing.

Currenty, RadScheduler does not support such a layout mode for printing. You can see the available printing layouts in this article: http://www.telerik.com/help/winforms/scheduler-print-support-schedulerprintstyle.html.

I have added a feature request for such in our Public Issue Tracking System. Feel free to add your vote for it here: http://www.telerik.com/support/pits.aspx#/public/winforms/14542.

I have updated your Telerik Points for this request. 

As a workaround I can suggest using the standard windows forms printing functionality to print the control as seen on the form. Here is a sample method:
private void PrintControl(Control control)
       {
           var bitmap = new Bitmap(control.Width, control.Height);
 
           var pd = new PrintDocument();
           pd.DefaultPageSettings.Landscape = true;
           control.DrawToBitmap(bitmap, new Rectangle(0, 0, control.Width, control.Height));
 
           pd.PrintPage += (s, e) => e.Graphics.DrawImage(bitmap, 100, 100);
 
           PrintPreviewDialog printPreviewDialog1 = new PrintPreviewDialog();
           printPreviewDialog1.Document = pd;
 
           if (printPreviewDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
           {
               pd.Print();
           }
       }


All the best,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Art
Top achievements
Rank 1
answered on 15 Mar 2013, 02:27 PM
Do you have that example in VB.NET?
0
Stefan
Telerik team
answered on 15 Mar 2013, 03:14 PM
Here you are:
Imports System.Drawing.Printing
 
Public Class Form1
    Dim bitmap As Bitmap
    Private Sub PrintControl(control As Control)
        bitmap = New Bitmap(control.Width, control.Height)
 
        Dim pd = New PrintDocument()
        pd.DefaultPageSettings.Landscape = True
        control.DrawToBitmap(bitmap, New Rectangle(0, 0, control.Width, control.Height))
 
        AddHandler pd.PrintPage, AddressOf PrintRange
 
        Dim printPreviewDialog1 As New PrintPreviewDialog()
        printPreviewDialog1.Document = pd
 
        If printPreviewDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
            pd.Print()
        End If
 
    End Sub
 
    Private Sub PrintRange(sender As Object, e As PrintPageEventArgs)
        e.Graphics.DrawImage(Bitmap, 100, 100)
    End Sub
 
    Private Sub RadButton1_Click(sender As System.Object, e As System.EventArgs) Handles RadButton1.Click
        PrintControl(RadScheduler1)
    End Sub
    
End Class


Regards,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Tags
Scheduler and Reminder
Asked by
Art
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Art
Top achievements
Rank 1
Share this question
or