GetLastRow or MaxDataRow returns 0

I use a lot of Smart Markers. After calling wkDesigner.Process(false), I like to know how many rows exist in the spreadsheet. Calling GetLastRow or MaxDataRow always returns 0. Do I miss something?

@sanshi,

May be there is no data/record for your inserted markers, either you have wrongly used markers or your markers are not matched to your data source. Moreover, you should just save the Excel file after markers are processed. Now check if the data is filled against markers when you open the output file into MS Excel manually. If you still find any issue or confusion, kindly do create a simple console application (runnable), zip the project with the template files and post us to show the issue, we will check it soon. Please use dynamic dataset or datatable in code to be used against Smart Markers (and remove any inter-dependencies to external database or datasources), so we could execute your code seamlessly to figure it out soon.

Thank you for the reply. The data actually were populated fine for all the smart markers. Just GetLastRow or MaxDataRow returns 0. I did modify the Aspose example to make it logically similar to what I had. And it worked fine. So I just did not know what it happened. Unfortunately I’m not able to share code.

@sanshi,

I think your issue is resolved now by following Aspose.Cells example(s), so that is good. It looks like there is some issue with your original code, so you may debug it and fix it accordingly as you do not want to share your sample code and data. By the way, please double check and confirm if you are referring to the same (correct) worksheet (in which you have processed markers) to evaluate GetLastRow or MaxDataRow attributes value. Anyways, in case, you still find the issue or any other issue, do share with some details and sample and we will help you soon.