Hi,
I want to set the Row height of the Excel row to some specifc defined value. I have used the below source code. But It didn't work.
string resourceFile = report.ExportTemplateFilename; StreamResourceInfo sr1 = Application.GetResourceStream( new Uri(resourceFile, UriKind.Relative)); Workbook wb = Workbook.Load(sr1.Stream);
wb.Worksheets[0].Rows[currentRow].Height = 21;
Please let me know the solution.
Thanks
Anil Kumar
What do you mean by "It didn't work"?
The row height is defined in twips, which are 1/20th of a point, so a value of 21 will give you a row which is about 1 pixel high. I'm guessing you want to instead set the row to a height of 21 points, which means you should assign a value of 420.
Mike,
Apologize for improper question? Excel was maintaining the same Row Height. It was not taking the Height mentioned in the Code. But the problem was different. It was throwing "Argument Exception" After looping 15 rows at below line.
wb.Worksheets[0].Rows[currentRow].Height = 41;
The Exception was "Parameter Name : height".
Another Doubt.
As per your suggestion If I set the RowHieght to 420. Its even not looping till 15 Times and Its throwing the Argument Exception at first loop.
The Exception was "Parameter Name : Width".
Please provide the Solution.