Compositelink Devexpress

Posted By admin On 27/11/21
  • 6 minutes to read
  1. Devexpress Compositelink Sheet Name
  2. Devexpress Composite Link
  3. Devexpress Composite Link Export To Excel
  4. Composite Link Devexpress

To do that you will want to add a printableComponentLink to each gridControl, and then Create a compositeLink that you can add each of the printableComponent links to. This link may prove DevExpress KB Article may prove useful as it has an example of that. Then you will use the compositeLink.ExportToXlsx method. This topic addresses the question of whether, and how, a complex windows form, comprised of different controls, can be printed in a custom manner. The XtraPrinting Library enables you to print out multiple components within a single report. To accomplish this a CompositeLink class is used. I have a grid which i have to export to pdf. I have accomplished this by using aspxgridviewexporter and printinsystem. Everything worked fine. The color of the header cells of the grid in the pdf has. Universal SubscriptionOur Best Value – includes over 600 UI Controls, our award-winning reporting platform, DevExpress Dashboard, the eXpressApp Framework, CodeRush for Visual Studio and more. DXperience Subscription Save Hundreds – includes DevExpress UI Controls for WinForms, ASP.NET, MVC, WPF, our award-winning reporting platform.

This topic addresses the question of whether, and how, a complex windows form, comprised of different controls, can be printed in a custom manner.

The XtraPrinting Library enables you to print out multiple components within a single report. To accomplish this a CompositeLink class is used. It enables you to combine several printing links in the desired order. Each printing link represents a report, so the composite link can actually be a nested report. Since each component which implements the IPrintable interface can be printed via the PrintableComponentLink instance, reports of high complexity can be easily created.

Let's illustrate it with a simple example. Suppose we have a windows form with two Data Grid controls. A printout should look as follows: a custom header, the first grid, empty space (a gap, page wide), a custom header for the second grid, the second grid. A timestamp in the upper margin is necessary.

We can represent each element (grid, header, empty space) with a printing link. Then we should combine them into one composite link and draw the PageInfoBrick in the MarginalHeader area of the page.

This example demonstrates how to combine reports in code. It uses event handlers to create detail areas of combined reports.

In a real task, you can use event handlers to create any area of a report, enclosed within the composite report, except for marginal headers and footers, which belong solely to the composite report itself (for areas definition, see Document Sections).

NOTE

You can create any areas within the enclosed reports, except marginal, so the LinkBase.CreateMarginalHeaderArea and LinkBase.CreateMarginalFooterArea events cannot be used.

The reports inserted within a report are also called 'subreports'. Subreports are automatically generated when you call the Link.CreateDocument method for the CompositeLink, or invoke the preview window using the Link.ShowPreviewDialog method.

Although the composite link technique, described earlier, is highly recommended, there are other ways to create subreports:

  • using the PrintableComponentLinkBase.AddSubreport method
  • using the PrintingSystemBase.BeginSubreport and PrintingSystemBase.EndSubreport methods

To insert a report generated by a specific link into another report, you can use the PrintableComponentLinkBase.AddSubreport method. This method must be called only when a report is being generated, not after. You can insert a subreport via the PrintableComponentLinkBase.AddSubreport method at any position between the PrintingSystemBase.Begin and PrintingSystemBase.End method invocations.

A subreport is inserted into the main report at the position where the xref:PrintableComponentLinkBasePrintableComponentLinkBase.AddSubreport method is called. The method also invokes the sequence of report area creation events. Only the LinkBase.CreateMarginalHeaderArea and LinkBase.CreateMarginalFooterArea events are not used in this sequence for a subreport. The printing system uses the first report page header or footer instead of the current report page header or footer.

You can also create subreports manually via a PrintingSystem object. The PrintingSystemBase.BeginSubreport and PrintingSystemBase.EndSubreport methods inform the printing system that a subreport should be inserted at a specific location.

Devexpress
TIP

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E15.