Sets or returns the maximum number of rows to be bound to the template file when the ExcelTemplate.BindData or ExcelTemplate.BindColumnData methods are called.

 public int MaxRows{ get; set; }
Public Property MaxRows() As Integer

Any rows in the data source after the MaxRows value will not be added to the template.

MaxRows is a Read/Write property.

          DataBindingProperties dbp = xlt.CreateDataBindingProperties();
          dbp.MaxRows = 20;
          xlt.BindData(twodim, names, "TwoDimArray", dbp);
          xlt.Save(Page.Response, "output.xls", false);

          Dim dbp As DataBindingProperties = xlt.CreateDataBindingProperties()
          dbp.MaxRows = 20
          xlt.BindData(twodim, names, "TwoDimArray", dbp)
          xlt.Save(Page.Response, "output.xls", False)