method ExPrint.ExtraCaption (Key as Variant, [Caption as Variant], [Position as Variant], [Alignment as Variant])
Adds or removes an additional caption on the page.

 TypeDescription 
   Key as Variant A string or a numeric expression that indicates an unique key for the extra caption being added or removed. If missing, or empty, whole extra captions are removed.  
   Caption as Variant A string expression that indicates the extra caption. If missing, or empty, the extra caption with the Key is removed.  
   Position as Variant A PositionEnum expression that indicates the position of the extra caption in the page. If missing, the exFooter value is used ( extra caption is displayed on the bottom of the page )  
   Alignment as Variant A AlignmentEnum expression that indicates the alignment of the extra caption in the page. If missing, the exLeft value is used ( extra caption is displayed on the left margin ).   
Use the ExtraCaption method to add an extra caption to the page. By default, only a single caption may be added to your page ( Caption property, for instance, you can add an extra caption to the bottom of the page to print the current date ). The ExtraCaption method may be called to add extra caption to any or all margins of the page. Use the Caption property to specify the name of the document being printed. Use the CaptionAlignment property to specify the alignment of the caption in the page. Use the CaptionPosition to specify the position of the caption in the page. Use the ShowPageNumbers property to specify whether the document displays or hides the page number. Use the Font property to assign a different font for the caption printed on the document. Use the <br> to break lines in the caption, and so you can display multiple-lines captions. Use the Images/ReplaceIcon method to add new icons to the control. Use the HTMLPicture property to add custom sized pictures.

Currently, the ExtraCaption property may include the following built-in HTML tags:

Also the ExtraCaption property supports the following predefined values:

The following VB sample adds an extra caption to the bottom of the page that shows the current date:

With Print1
        .ExtraCaption "Date", Date, EXPRINTLibCtl.PositionEnum.exFooter, EXPRINTLibCtl.AlignmentEnum.exLeft
End With

The following VB sample adds three extra fields to the page:

With Print1
    .ExtraCaption "A", "Header-Right", EXPRINTLibCtl.PositionEnum.exHeader, EXPRINTLibCtl.AlignmentEnum.exRight
    .ExtraCaption "B", "Header-Left", EXPRINTLibCtl.PositionEnum.exHeader, EXPRINTLibCtl.AlignmentEnum.exLeft
    .ExtraCaption "C", "Footer-Left", EXPRINTLibCtl.PositionEnum.exFooter, EXPRINTLibCtl.AlignmentEnum.exLeft
End With

The following C++ sample adds an extra caption to the bottom of the page that shows the current date:

COleDateTime date = COleDateTime::GetCurrentTime();
COleVariant vtDate;
V_VT( &vtDate ) = VT_DATE;
V_DATE( &vtDate ) = date.m_dt;
m_print.ExtraCaption( COleVariant("Date"), vtDate, COleVariant((long)1/*EXPRINTLibCtl.PositionEnum.exFooter*/), COleVariant((long)0/*EXPRINTLibCtl.AlignmentEnum.exLeft*/) );

The following VB.NET sample adds an extra caption to the bottom of the page that shows the current date:

With AxPrint1
    .ExtraCaption("Date", DateTime.Today, EXPRINTLib.PositionEnum.exFooter, EXPRINTLib.AlignmentEnum.exLeft)
End With

The following C# sample adds an extra caption to the bottom of the page that shows the current date:

axPrint1.ExtraCaption("Date", DateTime.Today, EXPRINTLib.PositionEnum.exFooter, EXPRINTLib.AlignmentEnum.exLeft);

The following VFP sample adds an extra caption to the bottom of the page that shows the current date:

with thisform.Print1
	.ExtraCaption("Date",Date(),1,0)
endwith

Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.