ExportToExcel logic is a default or customized logic ?
If it’s a default button, may be check you have applied any filters or not in the grid.
If it’s a customized logic then check the data retrieval you are trying to generate in excel.
In the images you posted i see that the export to excel function is in fact a microflow. What is exported here, depends totally on the implementation in the microflow. Can you publish the contents of the microflow?
BTW it would be far easier to switch from using a template grid widget to using a data grid widget (not data grid 2) and use the native export to excel button there. This is the quickest way to set up an export to excel. https://docs.mendix.com/refguide/control-bar/#export-to-excel-button