export to pdf

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 = pinPDF.enUnit.mm;
           
            objPdf.MarginLeft = 10;
        objPdf.MarginRight = 10;
           
            if (!objPdf.Process()) //
        {
            return "Error: " + objPdf.ErrorMessage;
        }
           
             return tempPrintFolder + fileName; //

      }
      This method return "\\\\192.168.11.113\\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
dataFound.pdf
dataNOTfound.pdf
enrique_aeoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jake072Commented:
enrique_aeo,

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?

Jake
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alexandre SimõesManager / Technology SpecialistCommented:
Hi,

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.

Cheers,
Alex
0
Alexandre SimõesManager / Technology SpecialistCommented:
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.

cheers,
Alex
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.