ReportViewer Export to PDF Loses Tabs and Multiple Blank Spaces

  • I have an ASP.NET 2.0 Web App, created with VS.NET 2005, and a remote report (SS2005) that displays perfectly in a browser. Upon exporting to PDF, any line that begins with tabs or multiple blank spaces gets collapsed and as a result my data is misaligned. What can I do to preserve the alignment?

  • This is a known issue which Microsoft refuse to accept as a bug so you either get your customer to accept the blank pages or use the bigger setting. I think what is happening is since Microsoft does not own PDF Reporting Services communication with PDF is not working as expected. Try below for Microsoft own solution which I can tell you did not work for me.

    http://blogs.msdn.com/bwelcker/archive/2005/08/19/454043.aspx

    Kind regards,
    Gift Peddie

  • Thanks for your response Gift... but my problem is not extra blank pages (though it was at one point)... the problem is that I am losing blank SPACES or TABS at the beginning of lines or rows of datahence, the resulting PDF has mis-aligned data. Thanks for any further efforts.

  • Then you have to either use script or manual property settings these are covered by Brian Larson in his book so you could check the BOL for how to set these properties.

    Kind regards,
    Gift Peddie

  • What is BOL?

    I tried using the following, but it won't open:

    Response.Clear();

    Response.ClearHeaders();

    Response.ClearContent();

    Response.AddHeader("Content-disposition", "attachment; filename=TestDeviceFilter.pdf");

    Response.ContentType = "application/pdf";

    Response.Buffer = true;

    StringWriter stringWriter = new StringWriter();

    HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);

    //this.RenderControl(htmlTextWriter); this is for whole page.

    RV_Reports.RenderControl(htmlTextWriter);

    Response.Write(stringWriter.ToString());

    Response.Flush();

    Response.Close();

    Response.End();

  • BOL(books online) SQL Server documentation and no you cannot render PDF through the response object without third party dll, I have answered that in the other thread.

    Kind regards,
    Gift Peddie

  • Thanks again for your time and responses.

    As far as setting properties, I have inspected the reportviewer properties as best as I can... would you have any idea of which property I would need to set? I have tried an number of various combos already without any luck. Again, the issue is that when exported to PDF, any leqding blank spaces or tabs are collapsed.

  • You are doing your development in reportviewer when you need to be in reporting services development IDE and not reportviewer control because you need to get the settings right in the report load it in report viewer and then export to PDF.

    Now I think you are spending time needed in actual report development in Visual Studio control the two work together but you need to do actual development of the report.

    Kind regards,
    Gift Peddie

  • I appreciate your efforts and time.

    Ok, I have developed and deployed the reports to our report server. When viewing the report from there, it looks great in HTML but upon export to PDF, all leading BLANK SPACES and TABS collapse and data is mis-aligned.

    If I am developing the report for the report server, what property do you propose may be set to control the collapsing of blank spaces?

  • Go and read the Microsoft article I posted most of the relevant settings are in that page and you need to look for existing solution because I have seen your PDF in the response object code so I still think you need to go back to the reporting IDE and look for issues with export.

    Kind regards,
    Gift Peddie

  • OK, I give up... I feel like I am running around in circles and keep having to repeat everything I have already said once or twice. I appreciate your desire to try to be helpful, but if you don't know what you are talking about, you should just leave a thread alone. The code with the response object is simply an alternate attempt to do what I couldn't accomplish with the built in Microsoft controls. Thanks anyways.

  • The information on the Microsoft page I posted is at least two days work yet you posted back in seven minutes that tells me you did not even read it. I am Asp.net MVP so I am now telling you the code in the response object cannot do anything in SSRS because the two are not related. So tomorrow go read that material it will take you at least 20 minutes but the actual work can take two days. Good luck.

    Kind regards,
    Gift Peddie

  • True, I did not read it entirely because I see it deals with printing blank pages, which is not my issue at all.

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply