export to pdf

Posted on 2008-11-19
Last Modified: 2013-12-17
I have datagrid of 20 columns, I give click him to export to pdf and it only exports 12 columns. the code to export to pdf if it reads the 20 columns
the component use is: Pintexx.Components.Web.pinPDF
private string PrintResponseView(int viewKey, string themeName, int menuKey)
            StringBuilder htmlForm = new StringBuilder(GetHTMLResponseView(viewKey, headerKey, footerKey, beginingKey, endingKey, fileName, themeName, menuKey));
            pinPDF objPdf = new pinPDF();
        objPdf.Html = htmlForm.ToString();
        objPdf.OutputPath = tempPrintFolder;
        objPdf.Orientation = pinPDF.enOrientation.Landscape;
        objPdf.FileName = fileName;
        objPdf.Unit =;
            objPdf.MarginLeft = 10;
        objPdf.MarginRight = 10;
            if (!objPdf.Process()) //
            return "Error: " + objPdf.ErrorMessage;
             return tempPrintFolder + fileName; //

      This method return "\\\\\\framework3-shared\\files\\PrintTemp\\621f9b3e-9c13-47d0-ae6f-afdef7e63eb0.pdf"
      I tested several and this it is the result
      1. data not found then  show 20 columns
      2. data found then  show 12 columns or 10 columns or 15 columns, following the registries that must export
        i attach two file
Question by:enrique_aeo
    LVL 14

    Accepted Solution


    What you are doing is printing the resulting HTML to a pdf.  If the page doesn't load correctly, then there isn't anything you can do (NO DATA).

    If it does print correctly, and you aren't getting all the lines, then I suspect it is due to some paging of the results?

    The pdf will ONLY show exactly what is on the page.  Perhaps you would be better to use the actual document.response, rather then calling it in your pdf creation?

    LVL 30

    Assisted Solution

    by:Alexandre Simões

    I never used that pdf converter control, so I can't help you with it.
    What I can do is point you a new way of doing that.

    For me, the best way of printing a grid is using a report.
    Although I don't like Crystal Reports it comes for free with Visual Studio and comes with the print to PDF functionality out of the box.

    The report can be as straight as a list or it can be made a bit more pleasant for the eye.

    LVL 30

    Assisted Solution

    by:Alexandre Simões
    Just to clear one thing...

    I say: "the best way of printing a grid is using a report"
    I mean, "the best way of printing the contents of a grid is using a report"

    For the report you pass the grid's datasource, not the grid itself.

    This is obvious, I just wanted to make it clear.


    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now