This is a migrated thread and some comments may be shown as answers.

Web Report Viewer - Hardcoded width of 624 pixels?

4 Answers 115 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eric Wallace
Top achievements
Rank 1
Eric Wallace asked on 03 Nov 2010, 10:44 PM
I have a 300 pixel pie chart that I'm trying to render on a web page. I have the width of the report viewer set to 300 pixels, but I still get a horizontal scrollbar. The table with id of 'Diskspace' is getting a hard-coded width of 624px. The nested table with the class s0 has a table-layout:fixed attribute that needs to go away as well and this will solve my problem. Is there any way to set a template for the report viewer or a way to override these hard-coded values?

Here is the rendered html of the iframe:

<body id="ReportBody" class="bodycenter" style="overflow: auto; margin: 0px; vertical-align: center;" onclick='BodyClickHandler();'>
 
<div id='ReportDiv' style='overflow:auto; width: 100%; height: 100%;'>
<table id='Diskspace' style='padding-left:0in;padding-right:0in;padding-top:0in;padding-bottom:0in;background-color:White;color:Black;font-family:Arial;font-size:10pt;font-weight:normal;font-style:normal;text-decoration:none;text-align:left;vertical-align:top;border-left-style:None;border-top-style:None;border-right-style:None;border-bottom-style:None;border-left-color:Black;border-top-color:Black;border-right-color:Black;border-bottom-color:Black;border-left-width:1pt;border-top-width:1pt;border-right-width:1pt;border-bottom-width:1pt;overflow:auto;word-wrap:break-normal;width:624px;margin-left: auto; margin-right: auto; overflow: hidden' cellspacing='0' cellpadding='0'>
<tr><td>
</td></tr>
 
<tr><td>
  <table cellspacing="0" cellpadding="0" border="0" style="width:100%;  table-layout: fixed;" class="s0">
  <colgroup>
    <col width="300px" />
    <col width="324px" />
  </colgroup>
  <tr valign="top" style="height:101px;"><td colspan="1" rowspan="1">
    <img alt="Chart" src="/Telerik.ReportViewer.axd?instanceid=2a15e0ff56534318865a798efc566a35&optype=ReportImage&StreamID=0qgrrjphoom" /></td>
    <td colspan="1" rowspan="1">
 
    </td>
  </tr>
</table>
</td></tr>
<tr><td>
</td></tr>
<tr><td>
</td></tr>
</table></div>
<script type="text/javascript">
     
var PageInfo = [0, 1];
var BookmarksOnPage = new Array();
 
</script></body>

4 Answers, 1 is accepted

Sort by
0
Eric Wallace
Top achievements
Rank 1
answered on 04 Nov 2010, 09:28 PM
Looks like I've answered my own question. The reportviewer will render the table with the width that you specify in the PageSettings > PaperSize property of the report.
0
Eric Wallace
Top achievements
Rank 1
answered on 04 Nov 2010, 09:56 PM
It appears I spoke too soon. Internet Explorer, in all it's infinite brilliance (sarcasm), renders it with scrollbars. Is there not a way to control the horrendous html that's generated by the report viewer...or render a chart directly to a page without the viewer (and not a pdf)?
0
Steve
Telerik team
answered on 05 Nov 2010, 09:10 AM
Hello Eric,

As you've found out, the viewer would use the dimensions specified in the page settings. If you want the chart to have 300 px width, then you should set the report width to 300 px and the viewer's width should be bigger than 300 px.
However using our reporting for the single purpose of displaying a chart on a web page is unnecessary. We have dedicated RadChart control which is meant exactly for this purpose and it uses the same engine as the chart item, so we highly recommend using it instead.

Sincerely yours,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Eric Wallace
Top achievements
Rank 1
answered on 05 Nov 2010, 04:04 PM
I ended up going the radchart route yesterday and it does what I needed it to do. As for the reports, the paper size needs to be set as well as the report width.

Thanks for your help, Steve.
Tags
General Discussions
Asked by
Eric Wallace
Top achievements
Rank 1
Answers by
Eric Wallace
Top achievements
Rank 1
Steve
Telerik team
Share this question
or