Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1590
Want ot set RowHeight of the Excel row.
posted

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

Parents
  • 44743
    Suggested Answer
    posted

    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.

Reply Children