XRControl.CanPublishOptions Property
Specifies report control visibility on printouts and in documents exported to specific formats.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v25.1.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
[SRCategory(ReportStringId.CatBehavior)]
public virtual CanPublishOptions CanPublishOptions { get; }
Property Value
Type | Description |
---|---|
CanPublishOptions | A |
Remarks
Use CanPublishOptions
to hide report controls in exported documents and printouts. The XRControl.CanPublishOptions
property allows you to access the CanPublishOptions object. Specify settings to hide a report control on printouts or when exported to a document in a certain format.
To hide a report control on printouts and in all exported documents, set CanPublishOptions.AllFormats to false
.
The following code snippet excludes page information (the XRPageInfo instance) when exporting a report to XLS, XLSX, and CSV formats:
using DevExpress.XtraReports.UI;
// ...
XtraReport report = new XtraReport();
DetailBand detailBand = new DetailBand();
report.Bands.Add(detailBand);
XRPageInfo xrPageInfo1 = new XRPageInfo{
// Add content.
};
detailBand.Controls.Add(xrPageInfo1);
// Hide xrPageInfo1 from XLS, XLSX, and CSV formats.
xrPageInfo1.CanPublishOptions.Xlsx = false;
xrPageInfo1.CanPublishOptions.Xls = false;
xrPageInfo1.CanPublishOptions.Csv = false;
You can also specify CanPublishOptions
in the Properties grid:
The following image illustrates the resulting XLXS document with and without page information: