How can i check or see the print preview of datagridview where my file is an access file and pls give me sample code.

Recommended Answers

All 2 Replies

To do the print preview part u need to add the print priview control or Dialog on ur form....

Member Avatar for CurtisUN

Hi,
It is very involved printing a datagridview. if you have a printdocument already setup then you can use the following code to preview the document.

 Private Sub PrintPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintPreview.Click


        Dim dlg As New PrintPreviewDialog()
        'Dim d As Object
        Dim d
        dlg.Document = PrintDocument1
        d = PrintDocument1.DefaultPageSettings.Bounds

        dlg.ShowDialog()
    End Sub

Curtis

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.