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
705
UltraGrid - PrintPreview not printing background colour
posted

Hi, I need the printpreview to reproduce the view of the ultragrid exactly as it is, background colours and all. How can I achieve this? I read in a very old post that it wasn't possible but wanted to know if that's still the case. Attached is an image of my grid and the result of PrintPreview. Thank you.

    Public Sub Print_grid(ByVal xGrid As Infragistics.Win.UltraWinGrid.UltraGrid)
        Try
            If xGrid.Rows.Count = 0 Then Exit Sub
            Dim doc As New System.Drawing.Printing.PrintDocument
            Dim Marg As New System.Drawing.Printing.Margins

            Marg.Left = 0
            Marg.Right = 0
            Marg.Top = 0
            Marg.Bottom = 30

            doc.DefaultPageSettings.Margins = Marg
            doc.DefaultPageSettings.Landscape = True

            xGrid.PrintPreview(xGrid.DisplayLayout, doc)

        Catch ex As Exception
            MsgBox(ex.Message & " // Print_grid // " & xGrid.FindForm.Name & "." & xGrid.Name)
        End Try

    End Sub

Parents
No Data
Reply
  • 7535
    Offline posted


    Hello,

    In order to understand the issue , I set up a sample of UltraGrid with ultraPrintPreviewDialog and everything you set on the grid does shows in the ultraPrintPreviewDialog by default.

    Here is my sample for the reference. If my sample is not the correct demonstration of the issue then feel free to modify it and send me back or you can share your own sample for further investigation.

    WindowsFormsApplication39.zip

Children