Problem exporting ReportViewer data to PDF/Excel RRS feed

  • Question

  • Issue with exporting to pdf

    I have a report that shows grouped data on a single page. The group field appears in the page header and is placed as a ReportItem (FieldItems cannot be placed in page header). All the data appears correctly when the report is opened in the web app from inside the browser, but when the same is exported to pdf, the group field in the page header is missing.

    The page header also contains some parameters passed to the report and they all appear correctly. Seems there is some problem only with exporting ReportItems. How can we make a ReportItem appear in the exported pdf file?

    Issue with exporting to excel

    Exporting to excel is worse. My report generates some 50 pages and exporting the report to excel prints the page header only for the last page. This header comes at the top of the exported excel file. The rest of the data follows without any group information i.e. data from all the groups is shown without any distinction.

    Any help would be appreciated.

    Thanks in advance,
    Friday, June 29, 2007 6:57 PM

All replies

  • Just a possible guess:


    Could this be a page break/size/width issue?  IOW could your item be there, but appearing on a separate page because it isn't fitting in the PDF layout?


    This would make sense if the item that isn't appearing is all the way to the right of all the ones that are...



    Saturday, June 30, 2007 6:04 PM
  • Thank you for posting reply Lisa.


    Page break/size/width is not an issue here. In fact I started investigating the problem from the same point. Try putting a ReportItem in the page header and export it to pdf. Even if the content of the ReportItem is very small, it is not exported to pdf. And I could not find any property of reportviewer control that needs to be set so that ReportItems gets exported.


    May be it is a bug in this control.May be it is a bug in this control......


    More ideas are welcome.


    Can the ReportViewer control team help on this!!!!!?????

    Sunday, July 1, 2007 7:05 AM
  • >> Try putting a ReportItem in the page header and export it to pdf.


    I have done this before, and I just did it again <shrug>.  Worked fine.  I put two different ones in the header, in fact.  Then I deployed it to a server, tried it again, exported to PDF, still fine.


    Then I put it in a winforms ReportViewer control, did fine coming through the PDF export.


    Then I put it in a webforms ReportViewer control, once again the PDF export looked good.


    Suppose you tell me a bit more about exactly what is in the specific ReportItem, since what I tried is probably nothing like what you tried?


    One thing that might affect it is the way the PDF (full pages at once) is rendered versus the page-by-page version you might be seeing in the non-exported version.  That *might* be dependent on exactly what expression you are using.


     I think we are a long way from deciding it's a bug...



    Monday, July 2, 2007 5:06 AM
  • I was able to find why my particular ReportItem was not being exported in the page header. The item that the ReportItem was referring to (in the body part of the report), was actually hidden in the report body, as this was the field on which the data was grouped on the page. I made that item visible on the body and it appeared in the header in the exported pdf file.

    Now I have another problem, I dont want this field to be shown in the report body as it has to be shown on the page header. But this one probably is simpler.

    Thanks for chipping in.
    Monday, July 2, 2007 6:33 PM
  • This is a goofy workaround but works.  Set the font color the same as the background color of the text box you put it in.



    Tuesday, July 3, 2007 1:01 PM
  • I've run into this exact same problem.  I am using the ReportViewer control in a Winforms application.  The reports render fine in the control. However when the report is exported to PDF first page has blanks where the Report Items should be, but subsequent pages in the Report had the ReportItems.  The excel exports had the same issue.


    I made the textboxes that contained the ReportItems visible and changed their font color to same as the report background and everything renders ok.  It is a crazy work around, but it does work!

    Tuesday, July 24, 2007 1:33 PM