Printing C1Schedule "as-is" choping image in viewer

Posted by: spaceage15 on 18 March 2020, 1:12 pm EST

  • Posted 18 March 2020, 1:12 pm EST

    I found a post on how to print the schedule exactly “as-is” you see on your screen on to a printdoc for preview posted here: https://www.grapecity.com/blogs/custom-wysiwyg-printing-of-c1schedule

    Following this example, the height of the schedule control is set to 1200. But this leads to the image being cut off in the preview not showing the entire schedule. Simply setting the height of the control to 1200 isn’t sufficient enough for different resolutions and screen sizes. Like in my case (1280 X 1024)

    Is there a way to calculate what the height for the scheduler control should be on the fly based on resolution that way it doesn’t chop the image when its previewed in the viewer?

  • Posted 18 March 2020, 1:29 pm EST

    After much trial and error, I tried a few things. Noticed that the scheduler control would display a scrollbar when it needs it automatically. So when there is a scrollbar, it chops the image in the viewer. If I make the height of the schedule control larger, the scrollbar goes away and there for the image that gets produced is correct. So I was thinking if I can have some variable that tells me that the scrollbar is visible for the user is true, then I know to increase the size of the C1Schedule control again until the scrollbar is gone. But the C1schedule.vScroll variables dont update its true or false values.

    Can someone help in this matter or point me in the right direction.

    Thanks in advance

    -Edson

  • Posted 18 March 2020, 9:59 pm EST

    Hi Edson,

    We have tried the WYSIWYG sample with various resolutions but did not face any issues at our end. Please share the steps that need to be followed to replicate the issue and the screenshot of the output that is cutting off at your end.

    It will help us to assist you in a better way.

    Regards,

    Prabhat Sharma.

  • Posted 19 March 2020, 12:42 pm EST - Updated 3 October 2022, 2:41 pm EST

    Hi Prabhat,

    Here is a screen shot of what I’m getting. This is just an example and I attached a running project which all I did was change the height of the schedule control to 700 instead of 1200. That should give you an idea

    Also, the WYSIWYG sample uses 1 hour interval. However, we allow our users to setup their own time scale interval in the C1Scheduler. They can set to either 5minute/15minute/30minute/1hour time intervals. This will significantly make the required height of the scheduler control in the printing process to be larger to make sure the capture takes in the entire schedule for the day in the snapshot.

    I would like to know if theres a way to calculate this height on the fly based on time interval, resolution, and such.

    Any suggestions would be great. thanks

    Regards

    CustomPrinting.zip

  • Posted 22 March 2020, 10:42 pm EST

    Hello,

    We are discussing the case with the developers and will get back to you with the updates soon.

    [Internal Tracking ID: 426895]

    Regards,

    Prabhat Sharma.

  • Posted 24 March 2020, 5:15 am EST

    Hi,

    sounds good to me. I appreciate it.

    Regards

  • Posted 24 March 2020, 1:28 pm EST

    Hi,

    As per the developers, it would be better to only change control size according to the paper size, so that it fits into the single page. Then, if not all content is visible, the application can try to scroll Scheduler to the bottom and print the second page.

    For this, the developer wants to know more details about your use case and does this approach make sense for you?

    Regards,

    Prabhat Sharma.

  • Posted 30 March 2020, 1:05 pm EST

    [b][quote=“prabhat.sharma”]

    it would be better to only change control size according to the paper size, so that it fits into the single page.

    [/quote][/b]

    Yes this it what I want to do. The ultimate question is how can I do that to accommodate all my users that have to ability to set their own start and end times of the schedule. Also my users are allowed the ability to change their time scale on running scheduler itself. As you can see, this poses a problem because I need to calculate all of these factors to size the control so it can fit on a single page.

    Is there a way to size the scheduler control until I know the scrollbar is gone? Maybe there is a scrollbar visible false boolean? At least when I know the scrollbar is no longer visible, I know the control is ready to have the snapshot taken.

    Regards

    Edd

  • Posted 30 March 2020, 6:37 pm EST

    Hi Edd,

    Thank you for the information and we have forwarded this to the developers and will let you know about the updates once we hear anything from their side.

    Regards,

    Prabhat Sharma.

  • Posted 3 April 2020, 3:19 am EST

    Hi Prabhat,

    Sounds good. I’ll wait for their response. thanks

    Regards.

  • Posted 10 August 2020, 10:56 pm EST

    Hello,

    ‘ScrollPosition’,‘ScollSize’ and ‘ScrollableRectangle’ properties can use to customize pagination when using different time scale intervals in C1Schedule in the latest version. You can refer to the WYSIWYG Printing sample to know how to use these properties for pagination.

    You can download the same from the following link:

    http://prerelease.componentone.com/dotnet452/c1winform/2020-t2/C1WinForms-452_4.5.20202.438.zip

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels