how to export datagridview to pdf in c# windows application

Поділитися
Вставка
  • Опубліковано 2 лют 2025

КОМЕНТАРІ •

  • @NgocDucDo
    @NgocDucDo 11 місяців тому

    Thank you very much for your videos.

  • @sarujanrajaratnam7097
    @sarujanrajaratnam7097 2 роки тому

    its works perfectly I really appreciate your work Thank you Man keep post like this video

  • @nandopookey9195
    @nandopookey9195 Рік тому

    Thank you so much sir

  • @vungochai7455
    @vungochai7455 2 роки тому

    thank you for sharing

  • @rizwanabid2
    @rizwanabid2 2 роки тому

    thanks for the help

  • @GODBABYBEATS
    @GODBABYBEATS 2 роки тому +1

    Cant open this pdf :(

  • @mohamedbouaouine4384
    @mohamedbouaouine4384 3 роки тому +1

    tank You prof

  • @ezequielcantu4592
    @ezequielcantu4592 2 роки тому +1

    The parameter of PageSize is not working, do u need a different extension or library to use it on Visual(?)

    • @susmantobealivebruh4238
      @susmantobealivebruh4238 2 роки тому

      Import the following it works for me!
      using iTextSharp.text;
      using iTextSharp.text.pdf;
      using Project_AD_Course_Work_1.Services;
      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.Data;
      using System.Drawing;
      using System.IO;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows.Forms;

  • @ET_HA
    @ET_HA Рік тому +2

    error while exporting dataobject reference not set to an instance of an object

    • @RashiCode
      @RashiCode  Рік тому

      Verify that the data object contains the required data and that it is not null

  • @MrWick-el4wk
    @MrWick-el4wk 2 роки тому

    How to make that it ignores one or more columns? and how to make text smaller or pdf bigger that more stuff could be added?

    • @RashiCode
      @RashiCode  2 роки тому +1

      i will check if i found any solution i will share with you

    • @MrWick-el4wk
      @MrWick-el4wk 2 роки тому

      @@RashiCode epic

  • @erosa003
    @erosa003 3 роки тому

    I visited your page and I don't find this code.. The link on desc. doesn't work. Help!!

    • @RashiCode
      @RashiCode  3 роки тому

      please check again it will work hope fully

  • @PatatAss-oc6zi
    @PatatAss-oc6zi Рік тому

    error while exporting data unable to cast object of type 'system.windows.forms.dataGridviewrow' to type' system.windows.form.dataGridview'. pls help idk where's the problem on my gridview

  • @MisteriesUndercover
    @MisteriesUndercover 3 роки тому

    I have a winform with multiple tabs, do you know how I can switch between them and print all of them into pdf?

    • @RashiCode
      @RashiCode  3 роки тому

      create data set that contain values of all tabs it work

  • @harikaranSrinivasan-e7n
    @harikaranSrinivasan-e7n Рік тому

    Possible graph take pdf is possible bro

  • @veritas8961
    @veritas8961 2 роки тому

    Thanks for this video tutorial. The material was helpful. But there was one problem: in the saved PDF file, only the name of the first column of the table is displayed, the rest of the cells are empty. Don't know what could be the problem?
    UPD:
    Found what's wrong. Russian letters cannot be displayed in cells.

    • @RashiCode
      @RashiCode  2 роки тому

      contact me at rashidhussain.kiu@gmail.com

    • @Inal9901
      @Inal9901 Рік тому

      Hello. same problem, how did you solve it?
      Tell me please

  • @alsafasoft2754
    @alsafasoft2754 2 роки тому

    This code does not support Arabic language
    How do I show the Arabic language?

  • @deshantharupathi
    @deshantharupathi 2 роки тому

    All codes are done. No errors. PDF created. But pdf not open. 🤔

    • @RashiCode
      @RashiCode  2 роки тому

      contact me at csharpaccademy@gmail.com

    • @RashiCode
      @RashiCode  2 роки тому

      rashicode.com/export-datagridview-data-to-pdf-file/
      download source code

  • @tihomirraicevic4761
    @tihomirraicevic4761 Рік тому

    Does anyone know why it creates a pdf file but that can't be opened?

    • @hihellohi2
      @hihellohi2 Рік тому

      Try to check if Line 79 in the video 12:56 is included.

  • @Unknown-bm5ui
    @Unknown-bm5ui 3 роки тому

    Can't open this file
    Problem with format

    • @RashiCode
      @RashiCode  3 роки тому

      visit rashicode i uploaded in details

    • @dotnetrfidhub2135
      @dotnetrfidhub2135 3 роки тому

      PdfWriter.GetInstance(document, stream); just add this line

    • @kadirgultekin7984
      @kadirgultekin7984 3 роки тому

      @@dotnetrfidhub2135 already this line writed in the code but it stil not working why?

    • @damiancortez1942
      @damiancortez1942 3 роки тому

      @@RashiCode link down :(

  • @lighton9451
    @lighton9451 5 місяців тому +1

    very long !!

  • @yorbindimolina3253
    @yorbindimolina3253 10 місяців тому

    No funciona

  • @fatiniss1434
    @fatiniss1434 3 роки тому

    Save pdf 0 octe

  • @Fype_YouTube
    @Fype_YouTube 2 роки тому +1

    pTable.AddCell(dcell.Value.ToString());
    System.NullReferenceException: 'Object reference is not set to an instance of an object.'
    System.Windows.Forms.DataGridViewCell.Value.get returned null.

    • @RashiCode
      @RashiCode  2 роки тому +1

      Basically what was happening is that the DataGridView object has a property called AllowUserTOAddRows and this auto adds a hidden row.. To fix this simply added dataGridView1.AllowUserToAddRows = false; to the beginning of my onclick event and this solves the issue.
      OR
      AllowUserToAddRows = false;
      from datagridview properties

    • @Fype_YouTube
      @Fype_YouTube 2 роки тому +1

      @@RashiCode thanks I have one last question, when it is a pdf, how should I adjust those dimensions so that there is no distortion?

    • @abrarali4903
      @abrarali4903 2 роки тому +1

      @@RashiCode even after doing this still error is showing

    • @yorbindimolina3253
      @yorbindimolina3253 10 місяців тому

      lo solventaron??

  • @Fype_YouTube
    @Fype_YouTube 2 роки тому +1

    @RashiCode Help

    • @RashiCode
      @RashiCode  2 роки тому

      open datagridview properties and set
      AllowUserToAddRows = false;