TCustomdxComponentPrinter.AddEmptyLinkEx(TdxReportLinkClass,TComponent) Method
Creates a new report link and adds it to the collection.
Declaration
function AddEmptyLinkEx(ALinkClass: TdxReportLinkClass; AOwner: TComponent): TBasedxReportLink;
Parameters
Name | Type | Description |
---|---|---|
ALinkClass | TdxReportLinkClass | The reference to the required report link class. |
AOwner | TComponent | The owner component for the created report link. The owner component automatically destroys the associated report link when the application destroys the component. You can call the DeleteLink procedure to destroy the created report link manually. |
Returns
Type | Description |
---|---|
TBasedxReportLink | Returns the created report link. Cast the returned object to the corresponding terminal report link class to access all public API members. The |
Remarks
Call the AddEmptyLinkEx
function to create a new empty (non-configured) report link of any required type.
The created report link is not associated with a source control. You need to use the link’s Component property to specify the content source control.
Tip
AddLink and AddLinkEx functions automatically associate the created report link with the specified parent control.
Code Example: Manage and Use Report Links at Runtime
The following code example creates a report link for an existing PDF Viewer control, prints its content without user interaction, and deletes the created report link:
uses
dxPSdxPDFViewerLnk; // Declares the TdxPDFViewerReportLink class
// ...
var
AReportLink: TBasedxReportLink;
begin
// Creates a PDF Viewer control report link
AReportLink := dxComponentPrinter1.AddEmptyLinkEx(TdxPDFViewerReportLink, dxPDFViewer1);
AReportLink.Component := dxPDFViewer1; // Associates the created report link with the source control
try
AReportLink.Print(False); // Prints chart content without user interaction
finally
dxComponentPrinter1.DeleteLink(AReportLink.Index); // Deletes the report link after export
end;
end;