Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi,

                                    I've got an XtraGrid which has got a good preview with devexpressPrintingSystem
                                    see Sans titre.JPG

                                    I need to get this preview has reportsource of xtraReport-SubReport

                                    how can I do ?

                                    I've got a report that contained subreport that I need to be the XtraGrid PrintingSystem

                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                Hi Dimitri, There is no built-in capability to assign a PrintableComponentLink output to the XRSubreport control. There are some possible solutions:

                                1. Use the page merging functionality to merge the main report pages with pages generated via PrintableComponentLink.
                                2. Convert your GridControl layout to a separate XtraReport document (see E108) and then embed it into the main report via the XRSubreport container.
                                3. Place the GridControl into the report document and synchronize its layout and datasource with the GridControl located on your Form. Refer to the How to print Master-Detail GridControl via the XtraReports suite ticket for an example of this approach.

                                Show all comments
                                • Dimitri ROBIN 05.03.2012

                                  oh

                                  I hope there will be a better solution as soon as possible

                                  thanks for reply but it's the result I need cause it on one page

                                  with header section
                                  detail which is datagrid
                                  and footer section

                                • Dimitri, As an immediate solution, you can convert your GridControl layout to a separate XtraReport document (see E108) and then embed it into the main report via the XRSubreport container. Thanks, Alex

                                • Dimitri ROBIN 05.03.2012

                                  please tell it to me when xtragrid will enable this fonctionnality

                                • Dimitri ROBIN 05.03.2012

                                  I've found this, it's seems to be promising

                                              Dim FS As New IO.MemoryStream
                                              pclBordereau.CreateDocument()
                                              pclBordereau.PrintingSystem.SaveDocument(FS)
                                              'Dim ps As New DevExpress.XtraPrinting.PrintingSystem()
                                              'ps.LoadDocument(FS)
                                              Dim l_Report As New DevExpress.XtraReports.UI.XtraReport()
                                              'l_Report.PrintingSystem = New DevExpress.XtraPrinting.PrintingSystem()
                                              l_Report.PrintingSystem.LoadDocument(FS)
                                              'ReportViewer.Report = l_Report
                                              X.XrSubreport1.ReportSource = l_Report

                                  but it dosen't work for now... ;(

                                • Dimitri,

                                  There is an alternative solution: place the GridControl into the report document and synchronize its layout and datasource with the GridControl located on your Form.
                                  Refer to the How to print Master-Detail GridControl via the XtraReports suite ticket for an example of this approach and let me know if you need any clarification.

                                  Thanks,
                                  Alex

                                • Dimitri ROBIN 05.03.2012

                                  ok it's not bad

                                  thanks a lot

                                  I've put this on Report

                                  Public Sub setGrid(GV As DevExpress.XtraGrid.Views.Grid.GridView)
                                          'gcBordereau = GV.GridControl
                                          'gvBordereau = GV

                                          WinControlContainer1.PrintMode = WinControlPrintMode.AsBricks
                                          Me.gcBordereau.DataSource = GV.DataSource 'List
                                          Me.gcBordereau.MainView.Assign(GV, True) 'View, True)

                                          Me.gvBordereau.BeginUpdate()
                                          For handle As Integer = 0 To Me.gvBordereau.DataRowCount - 1
                                              Me.gvBordereau.SetMasterRowExpanded(handle, True)
                                          Next
                                          Me.gvBordereau.EndUpdate()
                                      End Sub

                                • Dimitri ROBIN 05.10.2012

                                  is it possible with a banded grid view
                                  and if yes, with bands which contains vertical headers ?

                                • Dimitri ROBIN 05.10.2012

                                  sorry
                                  it's possible with banded grid view I've done it
                                  but how about vertical caption of bands
                                  I don't know how can I do

                                  can you help me ?

                                  exemple (see joined files)
                                  I've got this code

                                  Public Sub setGrid(GV As DevExpress.XtraGrid.Views.BandedGrid.BandedGridView, _Arch As String, _ChAffaire As String, _Lieu As String, _NatureTrav As String, _NomUsage As String)
                                          Try
                                              WinControlContainer1.PrintMode = WinControlPrintMode.AsBricks
                                              Me.gcSuiviPlan.DataSource = GV.DataSource 'List
                                              Me.gcSuiviPlan.MainView.Assign(GV, True) 'View, True)

                                              gvSuiviPlan.ClearGrouping()
                                              gvSuiviPlan.Columns(XtraMainForm.eDG.Activite).Group()
                                              gvSuiviPlan.Columns(XtraMainForm.eDG.Zone).Group()
                                              gvSuiviPlan.ActiveFilterString = String.Format("[{0}] IS NOT NULL", XtraMainForm.eDG.NomPlan)

                                              Arch.Text = _Arch
                                              ChAffaire.Text = _ChAffaire
                                              LieuChantier.Text = _Lieu
                                              NatureTrav.Text = _NatureTrav
                                              NomUsage.Text = _NomUsage
                                          Catch ex As Exception
                                              addError(ex)
                                          End Try
                                      End Sub

                                • Dimitri ROBIN 05.10.2012

                                  I've tried this but it seems do not work

                                  Private Sub sub_gMainView_CustomDrawBandHeader(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.BandedGrid.BandHeaderCustomDrawEventArgs) Handles gvSuiviPlan.CustomDrawBandHeader
                                          If e.Band IsNot Nothing Then
                                              If e.Band.Name.StartsWith(Adresse_Diffusion.bndAdresseDiffusion) Then
                                                  e.Info.Caption = ""
                                                  e.Painter.DrawObject(e.Info)
                                                  Dim state As System.Drawing.Drawing2D.GraphicsState = e.Graphics.Save()
                                                  Dim r As Rectangle = e.Info.CaptionRect
                                                  Dim sf As New StringFormat()
                                                  sf.Trimming = StringTrimming.EllipsisCharacter
                                                  'si c'est une adresse de diffusion
                                                  sf.FormatFlags = Drawing.StringFormatFlags.DirectionVertical Or StringFormatFlags.DirectionRightToLeft
                                                  sf.LineAlignment = StringAlignment.Center 'Far
                                                  Select Case e.Band.AppearanceHeader.TextOptions.HAlignment
                                                      Case DevExpress.Utils.HorzAlignment.Center
                                                          sf.Alignment = StringAlignment.Center
                                                      Case DevExpress.Utils.HorzAlignment.Near
                                                          sf.Alignment = StringAlignment.Near
                                                      Case DevExpress.Utils.HorzAlignment.Far
                                                          sf.Alignment = StringAlignment.Far
                                                      Case Else
                                                          sf.Alignment = StringAlignment.Near
                                                  End Select
                                                  e.Handled = True
                                                  e.Graphics.DrawString(e.Band.Caption, e.Appearance.Font, e.Appearance.GetForeBrush(e.Cache), r, sf)
                                                  e.Graphics.Restore(state)
                                              End If
                                          End If
                                      End Sub

                                • Hi Dimitri,

                                  Thank you for the update. If possible, provide a small sample project where your GridControl customization routine is included. We will check for a suitable solution.

                                  Thanks,
                                  Alex

                                • Dimitri ROBIN 05.11.2012

                                  ok thanks for reply

                                  this is a small sample project which contains vertical band on banded grid view that I don't manage to print verticaly

                                • Hi Dimitri,

                                  Thank you for sending your sample project. I am afraid you are referring to a known limitation. The CustomDrawBandHeader event isn't effective when generating a document for printing.

                                  Thanks,
                                  Alex

                                • Dimitri ROBIN 05.14.2012

                                  Hi,


                                  I'm hoping this is a joke... but I think not...

                                  It really bother me...


                                  is there a code to convert any bandedgridview to xrtable with printoptions ?

                                  cause with xrtable it's easy to print vertical headers

                                • Hi,


                                  I regret to say this but there are no alternative solution to the ones I mentioned previously.

                                  Feel free to update this ticket if you need any clarification.

                                • Dimitri ROBIN 05.24.2012

                                  up ?

                                • Dimitri ROBIN 05.29.2012

                                  Hi,
                                  maybe developpers can make the possibility to raise before and after print event to all control that the xtragrid makes when report is shown ?
                                  if it was we can replace text on each control by all we need... is it a futur possibility ?

                                • Dimitri,

                                  You should be able to update the GridControl layout via the XtraReport.BeforePrint event. If you are referring to a different report customization scenario, let me know.

                                • Dimitri ROBIN 05.29.2012

                                  thx, have you got an exemple please ?

                                • Dimitri ROBIN 05.29.2012

                                  how can I change (orientation to make it's angle=270) text of a band header of bandedgridview with beforeprint event ?

                                • Dimitri,

                                  If the required report layout can be generated only via the CustomDrawBandHeader event, I am afraid no alternative solution can be implemented via the XtraReport.BeforePrint event.

                                You must  log in  or  register  to leave comments

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners