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
675
Priting the content of a grid with a certain size of paper
posted

Hi,

I use the UltraGridPrintDocument to print the content of the grid infragistic.
I want to force the printer to print on a certain format of Paper which is 11 X 17 inches
When I configure the PaperSize the driver of the printer select a format but not the one that I have configured in the code

Example :
doc.DefaultPageSettings.PaperSize = doc.PrinterSettings.PaperSizes.Item(System.Drawing.Printing.PaperKind.Tabloid)  (Which is 11 X 17)
The printer Driver select this format 10.5 X 7.5 instead of 11 X 17

doc.DefaultPageSettings.PaperSize = doc.PrinterSettings.PaperSizes.Item(System.Drawing.Printing.PaperKind.Legal) (Which is 8.5 X 14)
The printer Driver select this format 11.69 X 8.27 A4 instead of 8.5 X 14


This is the code of my Printing Function

Public Sub PrintGrid()

        Dim frm As New PrintDialog
        Dim doc As New UltraGridPrintDocument

        Dim oProjet As New CProjetE(Pecleunik)

        ' On imprime la grille de planification avant.
        doc.Grid = Me.gridGestionProjetExecution
        doc.DefaultPageSettings.Landscape = True
        doc.FitWidthToPages = 1

        doc.Header.TextLeft = vbCrLf & CodeProjet.ToString & " - " & oProjet.NomProjet & vbCrLf & vbCrLf
        doc.Header.TextCenter = vbCrLf & "Date d'impression : " & Today.ToShortDateString

        ' On ajuste les marges du document       
        doc.DefaultPageSettings.Margins.Top = 25
        doc.DefaultPageSettings.Margins.Bottom = 25
        doc.DefaultPageSettings.Margins.Left = 25
        doc.DefaultPageSettings.Margins.Right = 25
        doc.Footer.TextRight = vbCrLf & "[Page #]"
        doc.DefaultPageSettings.PaperSize = doc.PrinterSettings.PaperSizes.Item(System.Drawing.Printing.PaperKind.Tabloid) ' 11 X 17
        frm.Document = doc

        If frm.ShowDialog() = Windows.Forms.DialogResult.OK Then
            doc.Print()
        End If

    End Sub

Thank in advance and have a nice day :)

 

 

Parents
No Data
Reply
  • 53790
    posted

    Hello Yannh,

     

    I try to reproduce your issue using version 11.1.20111.2030, but I was not able. Could you please take a look at the attached sample and let me know if you think that I didn`t reproduce your scenario or if you have any questions. Could you please inform us what is your current  version and installed service release. You could download the latest service release from our site: Infragistics.com -> MyIG -> My Keys and Downloads

    Regards

     

    UltraGirdPrintPageSettings.zip
Children
No Data