We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to use size,position,fittocell arguments in template markers using XlsIO?

This article explains how to use size, position and fittocell argument in template markers using XlsIO.

 

What is size argument?

 

The argument size specified in template marker applies the image to the specified size inside the cell. Height parameter is optional. Value of width is applied when height is not specified.

 

Syntax

 

%<MarkerVariable>.<Property>;size:width,height

 

Note: By default, the image width and height is set to 50.

 

Steps to use size argument

 

Create a workbook template with markers in it. Here, Employee is the marker variable referred to a class object, followed by its properties separated by dot (.).

 

 

The below screenshot shows how the markers are applied in workbook template.

 

                         

 

 

The below screenshot shows the output document generated using template markers with size argument.

 

                                    

 

 

What is position argument?

 

The argument position specified in template marker applies the image to the specified position inside the cell.

 

The possible horizontal positions are listed below,

  • Left
  • Center
  • Right

 

The possible vertical positions are listed below,

  • Top
  • Middle
  • Bottom

 

Syntax to mention the image horizontal and vertical positions

 

%<MarkerVariable>.<Property>;position:top-right

 

Syntax to mention the image horizontal position

 

%<MarkerVariable>.<Property>;position:right

 

Syntax to mention the image vertical position

 

%<MarkerVariable>.<Property>;position:top

 

Note: By default, the horizontal position is top and vertical position is left.

 

Steps to use position argument

 

Create a workbook template with markers in it. Here, Employee is the marker variable referred to a class object, followed by its properties separated by dot (.).

 

 

The below screenshot shows how the markers are applied in workbook template.

 

                         

 

The below screenshot shows the output document generated using template markers with position argument.

 

 

 

 

How to use size and position argument at same time?

 

The arguments position and size can be used as a combination to specify the size for the image and to specify the position of the image.

 

Syntax

 

%<MarkerVariable>.<Property>;size:width,height;position:right

 

 

Steps to use size and position argument

 

Create a workbook template with markers in it. Here, Employee is the marker variable referred to a class object, followed by its properties separated by dot (.).

 

 

The below screenshot shows how the markers are applied in workbook template.

 

                         

 

 

The below screenshot shows the output document generated using template markers with size and position argument.

 

 

 

What is fit to cell argument?

 

The argument position specified in template marker applies the image with cell’s height and width.

 

Syntax

 

%<MarkerVariable>.<Property>;fittocell

 

 

Steps to fittocell argument

 

Create a workbook template with markers in it. Here, Employee is the marker variable referred to a class object, followed by its properties separated by dot (.).

 

 

The below screenshot shows how the markers are applied in workbook template.

 

                         

 

 

The below screenshot shows the output document generated using template markers with fittocell argument.

 

 

 

Steps to use the template marker processor

 

  1. Create template marker processor.

 

 

  1. Add a variable name that is equal to the class object specified in the markers added into worksheet.

 

 

  1. Apply markers.

 

 

Download Input Files

 

Download Complete Sample

 

The following C#/VB.NET complete code snippet shows how to use template marker with size,position and fittocell argument in XlsIO.

 

 

 

 

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
8450 02/15/2018 02/15/2018 Windows Forms XlsIO
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.