ReportViewer.Render html outputs strange table layout

假装没事ソ 提交于 2019-12-11 05:26:55

问题


I'm new to reporting services and having trouble getting a report to render correctly on my ASPX page.

It seems no matter what I do to the layout of the report in the designer, the changes get ignored and the columns remain scrunched together with a big empty white space column to the right of it. Here's what I mean:

No matter what I change the widths of the columns to, it always renders like this:

By looking at the mark up I can see that a fixed width is being applied, and that the white space is TD with a width of 100%.

Here's the code I'm using/I've inherited:

result = rvDashlet.ServerReport.Render("HTML4.0", "<DeviceInfo><HTMLFragment>True</HTMLFragment></DeviceInfo>", out mimeType, out encoding, out extension, out streamids, out warnings);

The frustrating thing is, previously this report was being rendered as an image, which was working and looking fine. I've had to change it to HTML to allow for hyper-links to be added.

Any suggestions appreciated!


回答1:


I found this problem occurred when using SSRS 2005 with the following attributes on the reportviewer control:

syncRendering="False" SizeToReportContent="True" Width="100%"

This occured in IE, where the first TD containing the body of the report had no width specified, but the second TD had a width of 100%.

The id of the first TD is some random element such as Pdde6991e54b24a49a0a0b54433781b57oReportCell", which I've targeted with the following CSS:

td[id*='oReportCell'] {width:100% !important;}

Now the report takes the full width of the container, and the second empty TD shrinks to nothing.




回答2:


Since upgrading to reporting services 2008 from 2005, it seems to have solved the problem.



来源:https://stackoverflow.com/questions/7386526/reportviewer-render-html-outputs-strange-table-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!