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
145
Landscape printing in XBAP not working
posted

hi,

  ' 1. Create Report object

            Dim reportObj As New Report()

 

 

            ' aplly header template

            'reportObj.PageHeaderTemplate = TryCast(Me.Resources("PagePresenterHeaderTemplate"), DataTemplate)

            reportObj.PageHeaderTemplate = m_HeaderTemplate

            'apply footer template

            reportObj.PageFooterTemplate = m_FooterTemplate

            ' apply header content. In our case palin text

            'reportObj.PageHeader = txtHeader

            '' apply footer content. In our case palin text

            'reportObj.PageFooter = txtFooter1

            reportObj.ReportSettings.Margin = New Thickness(50, 0, 50, 0)

            reportObj.ReportSettings.PageOrientation = Infragistics.Windows.Reporting.PageOrientation.Landscape

            reportObj.ReportSettings.FileName = m_ReportTitle

 

            ' 2. Create EmbeddedVisualReportSection section. 

            ' Put the grid you want to print as a parameter of section's constructor

            Dim section As New EmbeddedVisualReportSection(m_Grid)

 

            ' set scale mode

            reportObj.ReportSettings.HorizontalPaginationMode = HorizontalPaginationMode.Scale

 

            reportObj.ReportSettings.PagePrintOrder = PagePrintOrder.Horizontal

 

            '' 3. Add created section to report's section collection

            reportObj.Sections.Add(section)

 

            '' 4. Call print method

            'reportObj.Print(True, False)

 

 

            Dim pt As New PrintTicket

 

            pt.PageOrientation = Printing.PageOrientation.Landscape

 

            Dim pq As PrintQueue = LocalPrintServer.GetDefaultPrintQueue()

            pq.UserPrintTicket = pt

 

            Dim pd As New PrintDialog()

            pd.PrintTicket = pt

            pd.PrintQueue = pq

 

            pd.PrintQueue.UserPrintTicket = pd.PrintTicket

            reportObj.ReportSettings.PrintQueue = pd.PrintQueue

 

            reportObj.Print(True, False)

 

 

 

please tell me why it always  print in portrait

 

thanx