Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

Help with exporting data from a DataGridView

Hi,

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

Thanks,

Victor
0
vcharles
Asked:
vcharles
  • 5
  • 4
1 Solution
 
Fernando SotoCommented:
Hi Victor;

Do you have a PDF library which will produce documents in PDF format?
0
 
vcharlesAuthor Commented:
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
 
jasnakozeljCommented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
vcharlesAuthor Commented:
Hi,

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

Thanks,

Victor
0
 
Fernando SotoCommented:
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
 
vcharlesAuthor Commented:
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
 
Fernando SotoCommented:
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
 
vcharlesAuthor Commented:
Hi,

Will do.

Thank You.

Victor
0
 
Fernando SotoCommented:
Not a problem Victor, as always glad to help.
0
 
vcharlesAuthor Commented:
Thank You.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now