For exmaple, I have a Java object named Teacher and a teacher can has many students.
In some templates, our customers wants to print the first five students and in others our customers wants to print all the students. I'm wondering if Smart Marker can print the first five students in an Arraylist using index?
Well, after looking into your requirement, we come to know and as I told you that our Smart Markers are pretty much straight forward, so it will totally depend on your source data (either in the array/list of table (database)) or as per your query(select statement) etc. Aspose.Cells cannot support your needs for Smart Markers, you have to control it by yourself. First of all check my SQL example for TOP N query, you may use it but you have to manage/fill your data source in some database/table accordingly. For example, you may have a worksheet that would behave for N (parameter) and you will hide that worksheet in the template file for each client accordingly for your number of records which you need to retrieve from the data source, then you can create collection with your desired parameter for your clients accordingly.
See the attached template file that has a first worksheet which would work to provide you the parameter for N number of records. The Sheet1 in the file should be hidden so no user could see it.
Sample code (this is generic code):
Workbook workbook = new Workbook(@"e:\test2\Book1.xlsx");
WorkbookDesigner designer = new WorkbookDesigner();
designer.Workbook = workbook;
int N = workbook.Worksheets.Cells["B1"].IntValue;
//......... Your query will be managed by you.
//SELECT TOP N select list
So, you should select the data with your desired N records in hidden worksheet and get it in your markers' sheet (second sheet) accordingly.
Hope, you understand it now.