Canadean_AS
02-27-2013, 02:42 AM
Hi,
Firstly, don't let the first few sentences put you off reading, a VBA solution will be fine, I can convert it myself.....
Bear with me while I describe the situation, the question itself is quite simple and near the end if you want to skip my rambling ! :)
OK, I have a number of reports written in SQL Server Reporting Services which I then export to Word. I then have a c# app that cleans up the rather messy output the SSRS generates.
One of the messy things SSRS does when outputting a table of data is to set the row height based on the font size rather than on the SSRS report design.
For instance, the SSRS report design has each row in the table at 0.6cm high. When the report is exported to Word the row height is set to 0.46cm and the rowheight rule is set to 'at least'. Now this is OK but there is too much space between the data so the rows needed to be shorter as the real/visible row height looks to be slightly bigger than my intended 0.6cm.
In my C# app I simply set the rowheight rule to 'exactly' and set the row height itself to my desired height.
This works fine unless the contents of any of the cells is too long and has to be wrapped as forcing the rowheight to be exactly 0.6cm means all the wrapped text is no longer visible.
OK, now the question!
Is it possible to determine the actual rendered height of a row rather than just the rowheight property.
e.g. If I have a cell in a row whos content is nearly 3 times the length of the cell width (so it wraps onto three lines), the rowheight property might read 0.46cm rowheightmode = 'at least' whereas visibly the row looks to be say, 1.5cm high. How can I find the '1.5cm' height.
I need to be able to reduce the row height on all rows where there is no wrapped text.
Hope this makes sense, any input is greatly appreciated...
thanks for looking.
Firstly, don't let the first few sentences put you off reading, a VBA solution will be fine, I can convert it myself.....
Bear with me while I describe the situation, the question itself is quite simple and near the end if you want to skip my rambling ! :)
OK, I have a number of reports written in SQL Server Reporting Services which I then export to Word. I then have a c# app that cleans up the rather messy output the SSRS generates.
One of the messy things SSRS does when outputting a table of data is to set the row height based on the font size rather than on the SSRS report design.
For instance, the SSRS report design has each row in the table at 0.6cm high. When the report is exported to Word the row height is set to 0.46cm and the rowheight rule is set to 'at least'. Now this is OK but there is too much space between the data so the rows needed to be shorter as the real/visible row height looks to be slightly bigger than my intended 0.6cm.
In my C# app I simply set the rowheight rule to 'exactly' and set the row height itself to my desired height.
This works fine unless the contents of any of the cells is too long and has to be wrapped as forcing the rowheight to be exactly 0.6cm means all the wrapped text is no longer visible.
OK, now the question!
Is it possible to determine the actual rendered height of a row rather than just the rowheight property.
e.g. If I have a cell in a row whos content is nearly 3 times the length of the cell width (so it wraps onto three lines), the rowheight property might read 0.46cm rowheightmode = 'at least' whereas visibly the row looks to be say, 1.5cm high. How can I find the '1.5cm' height.
I need to be able to reduce the row height on all rows where there is no wrapped text.
Hope this makes sense, any input is greatly appreciated...
thanks for looking.