Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
UI was cut of in XamDataGrid print report
posted

Hi, we have a XamDataGrid that has complex styles, I use EmbeddedVisualReportSection to generate report from the XamDataGrid. Some cells were cut of in the report, sometime the issue disappears when changing grid size on screen and generate report again. There are also some rows with different styles didn't display properly.

I used code below to generate print preview. Could you please provide insights on what might be wrong, and how to fix it?

 public partial class WindowPrinting : Window
    {
        Report report1 = new Report();

        public WindowPrinting(XamDataGrid grid)
        {
            InitializeComponent();

            grid.AutoFit = true;
            EmbeddedVisualReportSection selection = new EmbeddedVisualReportSection(grid);
            
            report1.Sections.Add(selection);
            report1.PageHeader = "Page Header";
            report1.PageFooter = "Page Footer";
            report1.ReportSettings.PageOrientation = PageOrientation.Landscape;

            xamReportPreview1.GeneratePreview(report1, false, true);
           
        }
    }

Thanks,

Crystal.