One of my C# windows application form has a functionality of downloading the data of entire form in a single excel sheet. The form has few labelboxes at the top which can be accepted as header of the form, in the middle portion of the form there is datagridview which fetches data using a datatable and in the lower part of the form resides footer section which has some textboxes, labelboxes etc. I know how to download data of a datagridview in a excel file, but I need to download the data of entire form(i.e. data of header + datagridview's data + data of footer section) in a single excel with proper formatting and alignment.
What I have tried:
On download button click I can only export the data of gridview in a excel file, but I need to download the data of the entire form.