Jump to content
Sign in to follow this  
ricardoM92

Exportar datagridview para pdf

Recommended Posts

ricardoM92

Ola.

tenho um programa com um datagridview e queria através de um botão exporta-lo para pdf ...

se poderem gostaria que me ajudassem

obrigado.

[]s

Share this post


Link to post
Share on other sites
ricardoM92

*correcção :S

imprimir o conteudo do data set, pois o datagridview está associoado ao dataset :S

obrigado

Share this post


Link to post
Share on other sites
PamkY

Também me dá jeito isto, já estive a pesquisar e por acaso fui encontrando algumas coisas.

Vou voltar a pesquisar e vou enviando os links para caso te seja util.

Share this post


Link to post
Share on other sites
PamkY

Aqui tens tal como prometido :)

http://www.completit.com/Portfolio/DGVE/Downloads.aspx

Adiciona as referências que isso trás e utiliza apenas isto:

using CompletIT.Windows.Forms.Export.Pdf;
using CompletIT.Windows.Forms.Export;

DGVEPdfExporter pdfExporter = new DGVEPdfExporter();
            DGVEBaseExportSettingsEditorForm dialog =
            DGVEExportSettingsEditorFormBuilder.CreateWrappingForm(pdfExporter);
            //You can also use the other overload of the CreateWrappingForm method
            //DGVEBaseExportSettingsEditorForm dialog =
             //DGVEExportSettingsEditorFormBuilder.CreateWrappingForm( new DGVEPdfExportSettingsEditor() );
            dialog.Settings = new DGVEPdfExportSettings();
            if (DialogResult.OK != dialog.ShowDialog())
                return;
            pdfExporter.Export(dataGridView1, dialog.Settings);

Share this post


Link to post
Share on other sites
ricardoM92

Funciona na Perfeição =D

Muito Obrigado.

Quando precisares de algo se puder ajudar já sabes xD

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.