Solved

Help with exporting data from a DataGridView

Posted on 2014-03-10
10
229 Views
Last Modified: 2014-03-13
Hi,

How do I export data from two DataGrids in one PDF file exactly as shown in the Grids?

Thanks,

Victor
0
Comment
Question by:vcharles
  • 5
  • 4
10 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 39919673
Hi Victor;

Do you have a PDF library which will produce documents in PDF format?
0
 

Author Comment

by:vcharles
ID: 39920037
Hi,

I don't, was hoping .NET library already had the required files to achieve this, I can export in excel, but was hoping to also export in PDG or Word.

Thanks,

Victor
0
 
LVL 1

Expert Comment

by:jasnakozelj
ID: 39920056
You won't be able to do it without a .NET library that is capable of document creation/generation. The only free libraries from Microsoft are Open XML SDK (Word only) or Office COM (this one is not recommended to use). There are also some 3rd party libraries which you can accomplish it by creating a template document first and then populate it with your (DataGridView) data from your application.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:vcharles
ID: 39920116
Hi,

I'm trying to avoid third party controls, how do I export the data in word?

Thanks,

Victor
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 39920488
Hi Victor;

iTextSharp is a free PDF library and can be install into your project by using NuGet from within Visual Studio. In the search box just type in iTextSharp.

This may be a better option because if I am not mistaken in order to print from a MS Word document each user of your code is going to need a copy MS Word so that the functions in MS Word can be called.
0
 

Author Comment

by:vcharles
ID: 39922094
Hi,

I'm sorry for the late reply, will look into and get back to you. I'm trying not to use third party controls unless I have no choice.

Thanks,

Victor
0
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 39922194
Hi Victor;

At the following link you will find a article on how to create, browse and modify a Word document, step by step. This subject matter is extensive and can not be answered in a couple of post so please go through the steps.

How to automate Word from Visual Basic .NET to create a new document
0
 

Author Comment

by:vcharles
ID: 39922214
Hi,

Will do.

Thank You.

Victor
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 39922518
Not a problem Victor, as always glad to help.
0
 

Author Closing Comment

by:vcharles
ID: 39926625
Thank You.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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