Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Page Viewer WebPart

  Asked By: Ronald    Date: Nov 30    Category: Sharepoint    Views: 4824

I have a small issue with me.

I am using page viewer web parts to display some records from asp pages.When the records are huge I get a scroll bar under the web part, so I encounter two scroll bars. One IE's and the other from Web part viewer.

I can increase the height of the Page Viewer Web part to avoid the scroll bar. I DON'T want to do that. Is there any dynamic way of assigning the height to the webpart after checking the number of lines/Content inside the web part?



2 Answers Found

Answer #1    Answered By: Christop Mcfadden     Answered On: Nov 30

You can do it with javascript on the page  in the page viewer. I couldn't put my
hands on the code quickly but I used this technique on a project a few years

Answer #2    Answered By: Stefanie Ruiz     Answered On: Nov 30

I have a page  with dataview web  part to display  pages pulled from a
document library as "news items". The dataview web part  displays the
pages in iframes, and this javascript in a content editor part on
the page resizes the iframes to avoid scroll  bars. The iframes have
onload="reSizeAll()". (For the purists, I experimented with trying
to get each iframe to just resize itself, but it never worked
properly - sorry...)

It's not exactly what you want, but hopefully it will help. I found
the basis for it somewhere on the net, but it's a while ago so I
can't give appropriate credit!

<SCRIPT LANGUAGE=javascript>
function reSize(FrameID)
var oBody = document.frames
var oFrame = document.all(FrameID);

//window.status = "Resizing: " + FrameID;
oFrame.style.height = oBody.scrollHeight +
(oBody.offsetHeight - oBody.clientHeight);
//oFrame.style.width = oBody.scrollWidth +
(oBody.offsetWidth - oBody.clientWidth);
//An error is raised if the IFrame domain != its container's
//window.status = 'Error: ' + e.number + '; ' +
function reSizeAll() {
var anIframeID;
var coll = document.all.tags("IFRAME");
if (coll!=null)
for (i=0; i<coll.length; i++)
anIframeID = coll[i].id;


Didn't find what you were looking for? Find more on Page Viewer WebPart Or get search suggestion and latest updates.