Is there a way to print the current view for the D

2019-08-13 18:33发布

问题:

I am currently using DevExpress 10.2 within Visual Studio 2010. I am printing the contents of the GridControl (with both one and two GridViews contained within). This shows all the current visible columns (and not the invisible columns) and all the data in a viewable manner.

My issue is the print preview always shows all the grouped rows and the master-detail rows fully expanded. I want to make it so that if the user has none of the groups or rows expanded then the print preview displays the grid with none of the groups or rows expanded. Also if the user expands the first group and rows fully then only the first group and rows will be expanded in the print preview and none other.

Is there a way to be able to do this? Currently I love the printing component other than this facet.

Currently I am doing this by:

 PrintableComponentLink1.CreateDocument()
 With PrintableComponentLink1.PrintingSystem.PageSettings
     .TopMargin = 40
     .LeftMargin = 2
     .RightMargin = 2
     .BottomMargin = 40
     .Landscape = True
 End With
 PrintableComponentLink1.ShowPreview()

Along with customizing the report via the CreateReportHeaderArea and the CreateMarginalFooterArea functions.

回答1:

Based on what I have tried it is not currently possible and this Issue on the DevExpress support site seems to confirm that.

Right now, in server mode with a master-detail grid, you can print all detail rows expanded (optionsprint.expandalldetails=true) or no detail rows expanded (optionsprint.expandalldetails=false).