print scheduler with all data on it

9 posts, 1 answers
  1. John
    John avatar
    60 posts
    Member since:
    Nov 2006

    Posted 27 Sep 2013 Link to this post

    I'm having problems printing the scheduler with all resources on it.  I have a day view scheduler with 6 resources.  you can see 4 on the screen and then have to scroll right to see the other 2.  
    when i print the scheduler i have 2 issues. 
    1.  only the visible page of the first 4 resources show on the printout.  I need all 6
    2.  how do i get the actual resource columns to show on the printout?  right now i only see the appointments.

    Thanks!
  2. George
    Admin
    George avatar
    500 posts

    Posted 02 Oct 2013 Link to this post

    Hi John,

    Thank you for contacting us.

    In order to show all the resources you need to change the End Date in the Print Settings Form (see settingsForm.png), this dialog can be accessed from the PrintDialog (see settingsButton.png).

    You can also group by Resource from that same Print Settings Form, this will show the resources also.

    I hope this helps.

    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. John
    John avatar
    60 posts
    Member since:
    Nov 2006

    Posted 02 Oct 2013 Link to this post

    Thanks George.  I'm using all code to do the printout, but i found the properties from your shots in code.  That gets me closer.

    I have a couple issues now i need help with please.

    1.  each resource gets its own page when i group by resources.  How do i get them all on 1 page, or say something like 4 per page if there's a bunch?

    2.  I use the telerik markup text stuff to show text on the appointments.  When printed it shows as the markup not the colored/formatted text like the scheduler shows.  see the example image upload.  how do i fix that.

    3.  how do i make the print out match the number of divisions on the hour schedule.  for example, the printout is by 1/2 hours, but my schedule lines are by 1/4 hours.  The schedule shows the first 2 appointments correctly, one's from 8 to 845 the other 845 to 10 but the print out overlaps them.  see the example for this too.

    Thanks!
  5. Answer
    George
    Admin
    George avatar
    500 posts

    Posted 07 Oct 2013 Link to this post

    Hello John,

    Thank you for contacting us.

    Regarding your first question we have a feature request in our Public Issue Tracking System. You can find it at http://www.telerik.com/support/pits.aspx#/details/Issue=13538. Feel free to add your vote in order to increase its priority.

    As for your second question I have added a new bug report. You can find it on the following URL - http://www.telerik.com/support/pits.aspx#/public/winforms/15889. As a workaround for the time being, you can strip the html tags:
    void scheduler_AppointmentPrintElementFormatting(object sender, PrintAppointmentEventArgs e)
    {
        string replaceBr = e.AppointmentElement.Text.Replace("</br>", " ");
        string result = Regex.Replace(replaceBr, @"<[^>]*>", string.Empty);
        e.AppointmentElement.Text = result;
    }

    We also have a bug already reported regarding your third question - http://www.telerik.com/support/pits.aspx#/details/Issue=15198. Meanwhile you can handle the CellElementPaint method and customize your TimeScale. In the sample code below I have implemented a 30 minutes TimeScale:
    private void dailyStyle_CellElementPaint(object sender, PrintSchedulerCellPaintEventArgs e)
    {
        Rectangle bounds = e.Bounds;
        if (bounds.X == 100 && bounds.Width == 40)
        {
            using (Pen pen = new Pen(Color.Black))
            {
                Point p1 = new Point(bounds.X, bounds.Y + bounds.Height / 2);
                Point p2 = new Point(bounds.X + bounds.Width , bounds.Y + bounds.Height / 2);
                e.Graphics.DrawLine(pen, p1, p2);
            }
      
            using (StringFormat format = new StringFormat())
            {
                using (SolidBrush brush = new SolidBrush(Color.Black))
                {
                    format.Alignment = e.CellElement.GetHorizontalAlignment(e.CellElement.TextAlignment);
                    format.Alignment = e.CellElement.GetHorizontalAlignment(e.CellElement.TextAlignment);
                    format.LineAlignment = e.CellElement.GetVerticalAlignment(e.CellElement.TextAlignment);
                    format.Trimming = e.CellElement.StringTrimming;
                    format.FormatFlags = e.CellElement.StringFormatFlags;
      
                    Padding padding = e.CellElement.TextPadding;
                    if (padding != null)
                    {
                        bounds.X += padding.Left;
                        bounds.Y += padding.Top;
                        bounds.Width -= padding.Horizontal;
                        bounds.Height -= padding.Vertical;
                    }
                    Rectangle rect = new Rectangle(bounds.X, bounds.Y + bounds.Height / 2, bounds.Width, bounds.Height);
                    TimeSpan time = TimeSpan.Parse(e.CellElement.Text);
                    time = time.Add(new TimeSpan(0, 30, 0));
                    e.Graphics.DrawString(string.Format("{0}:{1}", time.Hours.ToString("00"), time.Minutes), e.CellElement.Font, brush, rect, format);
                }
            }
        }
    }

    Your Telerik Points were updated in accordance with your report.

    Let me know if I can help you further.
     
    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. John
    John avatar
    60 posts
    Member since:
    Nov 2006

    Posted 08 Oct 2013 Link to this post

    Thanks again George.  My appointments still aren't aligned though using your solution for #3.  in my original example the appointments were at 815 and 845but the schedule shows them at 830 for appt 2 and 8 for appt 1 and overlaps them.  i got my schedule time scale like i need now, but the appointments don't reflect the real time they're at still.

  7. George
    Admin
    George avatar
    500 posts

    Posted 11 Oct 2013 Link to this post

    Hello John,

    Thank you for replying.

    On my end appointments appear on the right place. I also tried to set their end to be at HH:45 or HH:15, however they were still not overlapping or anything of this sort. Please refer to the below image for reference.

    Let me know If I can be of further assistance.

    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  8. John
    John avatar
    60 posts
    Member since:
    Nov 2006

    Posted 11 Oct 2013 Link to this post

    George, your screen shot has them all at perfect 1/2 hours that's the problem.

    add 2 appointments, both on the same resource.  one at 815 and ending at 845.  another at 845 ending at 930 and then print the schedule.  they do not come out right.  On the print out they print at 8 to 9 and 830 to 930 like the attachment i provided.  that is not correct, they should print out at the same time as they are on the schedule.
  9. George
    Admin
    George avatar
    500 posts

    Posted 16 Oct 2013 Link to this post

    Hello John,

    Thank you for writing.

    By default the scheduler is rounding the time, to achieve the behavior you desire you would need to create your own PrintStyle. Below you can find attached a .cs file with the class in it. You can replace the print style as follows:
    this.scheduler.PrintStyle = new MyPrintStyle();

    I have also logged a new feature request in order to allow easy access to the print methods. You can find the request at - http://www.telerik.com/support/pits.aspx#/public/winforms/15944.

    Your Telerik Points were once again updated accordingly.

    I hope this will help you to achieve the desired effect.

    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  10. John
    John avatar
    60 posts
    Member since:
    Nov 2006

    Posted 04 Nov 2013 Link to this post

    Thanks that worked great.
Back to Top
UI for WinForms is Visual Studio 2017 Ready