Rpt displaying properly in "preview" not in "print layout"

Andy_SmithAndy_Smith Member Posts: 31
edited 2012-08-14 in NAV Three Tier
I'm a bit of a neophyte in NAV, but I've got a report in RTC RDLC from R2 (32012) that is not displaying the page header properly in "print layout" (or physically printed) mode but shows up just fine in the standard preview mode.

For the most part I've been using the standard invoice (10074) as an instructional guide as it both displays a logo image and a text field that says "copy" if it isn't the first page as this closely mirrors what I want to do. I did follow Claus's guide on blogs.msdn.com on "how to add a company picture to a report" and that did allow me to see the report properly in preview mode, but when I go to print it physically or view it in print layout it does not display correctly.

Specifically, I have two issues:

1. The company logo displays a small box with a red X in "print layout" mode.
2. I have variable that denotes which of three copies a report is, (Customer, Driver, Office). On preview mode this correctly is set for each page, but in print layout mode it only displays the last value value on every page. EDIT: to clarify, the "copy name" is actually what the table grouping is on. The report design has a "CopyLoop" integer component which in the OnAfterGetRecord sets the copy name, and the RDLC layout then groups the data based on the copy name. Doing an "about this report" on a data set with a single data item will indeed show three data lines with a distinct copy name for each line as it repeats the data for each copy that is to be printed.

I've perused several articles here discussing problems getting images to print, but I've not seen anybody mention it printing correctly in preview mode but not in print layout. The fact that it does print in print preview mode leads me to believe I'm at least close to getting this to work but I'm hitting a wall. I have no idea what to do with issue 2, I've not been able to find search terms that bring up relevant topics.

Layout shown below. The four red textboxes at the top of the header are where I'm setting first the image "SetPicture", then three separate SetInfo calls for the fields shown in the first row of the table (part of the first numbered group's header) that contains data items separated by "Chr(177)". The text showing which copy a given page is is the field near the top right shown in bold text starting with "=Code.GetInfo(1,2)". All the other header data shows correctly.

452e3033.jpg

Answers

  • skullaskulla Member Posts: 140
    Try to decrease the height of four textboxes on the top of the report which will set data.
  • dave_cdave_c Member Posts: 46
    For the first issue I would suggest making the text boxes where you do the set data and get data visible whilst you are trying to fix this report. Quite often there can be an error displayed in one if it's not working correctly but you can't see it as the text box is set to not visible.

    The second issue I'm not sure about, I would probably try copying what the sales invoice (206) does and moving the fields at the top of the table out into textboxes and do the grouping using a list instead.
  • Andy_SmithAndy_Smith Member Posts: 31
    Skulla: Alas, that made no difference, but thank you for the suggestion.

    Dave C:

    - Made the text boxes visible, but that made no visible difference. The text boxes in question don't actually contain any data, they just make a call to my two code functions that set data (one for picture, three calls to the same routine to set various bits of header information).
    - I actually had already tried that (although to note that both the sales invoice and my prior attempt actually put it in a small separate table rather textboxes). I'd seen that 10074 did that for the logo data so I did try that with the effect that my first page did end up having a functional picture in print layout mode but successive pages did not (and my labels for copy name didn't work at all). The way I have it shown above at least has pictures and copy names showing up properly in preview mode. I will try it however using textboxes instead, the RDLC does seem a tad sensitive about pulling header data from tables. I'll let you know if textboxes work out.
  • Andy_SmithAndy_Smith Member Posts: 31
    Dave C:

    I tried your suggestion to move the header data things out to text boxes in the body and it had the same result as putting the header data in a separate preceding table: The logo prints correctly on page 1, but gives the same generic red X on pages 2 and 3, the operation of the "copy name" remains the same. I'm finding this particularly odd that doing this makes it print the logo correctly on the first page. I'm going to try to get around the copy name issue by pulling out the copy name to a separate text item in the detail level and make a Set call on every line.
  • skullaskulla Member Posts: 140
    When you made the first row of text boxes visible, did it print any data?
  • Andy_SmithAndy_Smith Member Posts: 31
    A big thank you to Claus L. who helped me debug this issue.

    The key to making everything display properly appears to be in setting the "hidden=TRUE" flag on the individual text boxes in the first row of the group header (where the data for the page header is). What I was doing was to put the hidden flag on the entire row. Taking the hidden flag off the row means that I had to collapse the first row as small as possible, but it then was able to pick up the image and the "copy name" just fine.
  • clauslclausl Member Posts: 455
    A pleasure helping you Andy.

    /Claus Lundstrøm
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
Sign In or Register to comment.