I'm using XamOutlookView for a scheduling application and it is really working great! My customers are quite happy with it. I do however have a small problem. I'd like to print the schedule for the day or week and haven't figured out how to do it.
It is possible to add the on screen view to the report like this: EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(MyOutlookView);
but that only shows what is on the screen. We need it to show at least all the working hours.
What is the best way to accomplish this?
Thanks!
This code allows you to do what I was asking. Simply call the Print() method and pass it the XamOutlookCalendarView.
code is borrowed from http://stackoverflow.com/questions/7931961/wpf-printing-to-fit-page
private void Print(Visual v) {
System.Windows.FrameworkElement e = v as System.Windows.FrameworkElement; if (e == null) return;
PrintDialog pd = new PrintDialog(); if (pd.ShowDialog() == true) { //store original scale Transform originalScale = e.LayoutTransform; //get selected printer capabilities System.Printing.PrintCapabilities capabilities = pd.PrintQueue.GetPrintCapabilities(pd.PrintTicket);
//get scale of the print wrt to screen of WPF visual double scale = Math.Min(capabilities.PageImageableArea.ExtentWidth / e.ActualWidth, capabilities.PageImageableArea.ExtentHeight / e.ActualHeight);
//Transform the Visual to scale e.LayoutTransform = new ScaleTransform(scale, scale);
//get the size of the printer page System.Windows.Size sz = new System.Windows.Size(capabilities.PageImageableArea.ExtentWidth, capabilities.PageImageableArea.ExtentHeight);
//update the layout of the visual to the printer page size. e.Measure(sz); e.Arrange(new System.Windows.Rect(new System.Windows.Point(capabilities.PageImageableArea.OriginWidth, capabilities.PageImageableArea.OriginHeight), sz));
//now print the visual to printer to fit on the one page. pd.PrintVisual(v, "Epi-flex Dispatcher");
//apply the original transform. e.LayoutTransform = originalScale; } }
Hello,
Thank you for your reply. I have further researched the ability to print the XamSchedule controls and it seems that currently you can print only the visible part of the control using the EmbeddedVisualReportSection class as you have mentioned. This is the reason I have submitted the Product Idea to have the ability to print your XamOutlookView, built-in.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
I still haven't figured out how I'm going to handle the problem since I'd like the appearance of the printout to at least somewhat resemble how it looks on the screen and I'm not very competent in the printing realm yet. So... any pointers you could give would be appreciated...
I am just checking if you require any further assistance on the matter.
Thank you for your post. After researching this functionality, it has been determine as a new Product Idea. I have sent your Product Idea directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this Product Idea is PI12070188
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Thank you for your request.