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;
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
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.
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.
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
Thank you very much for your videos.
its works perfectly I really appreciate your work Thank you Man keep post like this video
Thank you so much sir
🖤🖤
thank you for sharing
❤❤
thanks for the help
❤❤
Cant open this pdf :(
tank You prof
❤❤
The parameter of PageSize is not working, do u need a different extension or library to use it on Visual(?)
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;
error while exporting dataobject reference not set to an instance of an object
Verify that the data object contains the required data and that it is not null
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?
i will check if i found any solution i will share with you
@@RashiCode epic
I visited your page and I don't find this code.. The link on desc. doesn't work. Help!!
please check again it will work hope fully
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
I have a winform with multiple tabs, do you know how I can switch between them and print all of them into pdf?
create data set that contain values of all tabs it work
Possible graph take pdf is possible bro
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.
contact me at rashidhussain.kiu@gmail.com
Hello. same problem, how did you solve it?
Tell me please
This code does not support Arabic language
How do I show the Arabic language?
All codes are done. No errors. PDF created. But pdf not open. 🤔
contact me at csharpaccademy@gmail.com
rashicode.com/export-datagridview-data-to-pdf-file/
download source code
Does anyone know why it creates a pdf file but that can't be opened?
Try to check if Line 79 in the video 12:56 is included.
Can't open this file
Problem with format
visit rashicode i uploaded in details
PdfWriter.GetInstance(document, stream); just add this line
@@dotnetrfidhub2135 already this line writed in the code but it stil not working why?
@@RashiCode link down :(
very long !!
No funciona
Save pdf 0 octe
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.
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
@@RashiCode thanks I have one last question, when it is a pdf, how should I adjust those dimensions so that there is no distortion?
@@RashiCode even after doing this still error is showing
lo solventaron??
@RashiCode Help
open datagridview properties and set
AllowUserToAddRows = false;