Dimitri ROBIN
05.03.2012
1 Solution
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
-
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
-
please tell it to me when xtragrid will enable this fonctionnality
-
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_Reportbut 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 -
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 = GVWinControlContainer1.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 -
is it possible with a banded grid view
and if yes, with bands which contains vertical headers ? -
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 docan you help me ?
exemple (see joined files)
I've got this codePublic 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 -
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 -
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 -
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.
-
up ?
-
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.
-
thx, have you got an exemple please ?
-
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.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.
Facebook
Twitter
Google+