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.
There is not enough information to determine what the problem is here. What type of exception is being thrown? What is the full exception message? Can you post a stack trace of the exception?
Hi Mike,
I have pasted the Exception and Stack-trace .
Exception Message :- Parameter name: width
StackTrace :- at System.Windows.Rect..ctor(Double x, Double y, Double width, Double height) at Infragistics.Documents.Excel.WorksheetShape.GetBoundsInTwips(WorksheetCell topLeftCornerCell, Point topLeftCornerPosition, WorksheetCell bottomRightCornerCell, Point bottomRightCornerPosition, PositioningOptions options) at Infragistics.Documents.Excel.WorksheetShape.GetBoundsInTwips(PositioningOptions options) at Infragistics.Documents.Excel.WorksheetShape.GetBoundsInTwips() at Infragistics.Documents.Excel.WorksheetShape.OnBeforeWorksheetElementResize() at Infragistics.Documents.Excel.Worksheet.OnBeforeWorksheetElementResize(RowColumnBase worksheetElement) at Infragistics.Documents.Excel.WorksheetRow.set_Height(Int32 value) at CS.MixVisualization.Views.AdhocReport.CreateExportFile()
Greatly appreciated if you respond by end of day.....
Anil kumar
Hello Anil,
I am still following your issue. Have you been able to resolve this issue? If you have any concerns or questions I will be glad to help.
I was looking into this issue and I am not able to reproduce the exception you are referring. Could you please have a look at the attached sample and modify it in order to reproduce your issue. Also could you please specify the version of our product that you use and also the file you are loading.
Thanks in advance.
This looks like it might be a bug in the cell measuring logic. This should be investigated by Developer Support so we can find the issue if one exists. I have forwarded this post to the Developer Support Manager and a DS engineer will be contacting you about this issue.