Big image causes blank pages even after scaling it down and deleting it!

Local Report.

I'm not sure what the issue is here but my problem started with print layout having too many pages - adding a blank with header and footer for each real page. I made sure that nothing was near the margins and even set the margins to .5 for each report and subreport. No good. So I searched the forum and found other complaints about this. One person said that he recreated the report and didn't have the problem after that.

So I began with a new main report and started adding stuff to see when the problem started. Once I added the icon, that did it. The image is embedded in the report so the image1 source is set to embedded and the value set to the jpg. However, when I first set the value, the image loads full size and makes the header real big. So I set it to fit and changed the size to 1in * 1in. Looks good. But it keeps printing an extra page.

I DELETED IMAGE1! and it still prints an extra page even though the image is gone. I'm looking at the XML for the report and this huge embedded image is in it. There appears to be no way to remove that image through the Embedded Image report menu item. Delete is greyed out. Dare I try to edit the XML Will this produce a cure if successful Stay tuned.

Success! I deleted the embedded image but left the <EmbeddedImages> tags. Don't do that, Studio complains bitterly. If you have no images, deleted the EmbeddedImages opening and closing tags. That didn't cure the problem though. Down near the end of the XML is a Width tag (right above an InteractiveHeight tag) which was set to 9.375. I changed it to 6.125 and all is well.

I suggest that if you have problems with blank pages printing, changing that Width value may cure the problem.

Now I have to see about scaling down an image BEFORE embedding it in the report. Hmm. Paint isn't going to do it. Well, I'll ask someone else to do that; I'm a programmer, not an artist.

 



Answer this question

Big image causes blank pages even after scaling it down and deleting it!

  • SQL_Steve

    Every reportitem (including textbox) has a Visibility property. You could hide the textbox if the value is null. E.g. set the Visibility.Hidden property to =(Me.Value is Nothing)

    Me.Value references the value of the current textbox. If it is null, the textbox will be hidden.

    -- Robert



  • Sami Zaghloul

    Good trick, thanks.
  • Chantcd_com

    If Width > (PageWidth + MarginLeft + MarginRight), you will get those additional blank pages representing the full horizontal width of the report that does not fit on just one page.

    Note: deleting the image or other reportitems will not automatically reduce the report width. You can however easily change the width by setting the property explicitly or by dragging the right edge of the report in report designer to the left.

    You may want to read this blog article - it contains some useful information on pagination: http://blogs.msdn.com/bwelcker/archive/2005/08/19/454043.aspx

     

    -- Robert



  • Pablitott

    Thanks, yes I found the width property after I edited the XML. The blog entry explains much. Actually, the whole layout vs physical report is interesting since things do expand as needed. The layout of a subreport seems to mean nothing since it is the actual RDLC that is referenced by the subreport that controls the size of the page.

    This should probably be a separate post but is there a way to get a textbox to take up no lines if the field is empty


  • Big image causes blank pages even after scaling it down and deleting it!