I looking for a example of VB export gridview to PDF , all that I can find use C# or VB.net to a web page. Using ItextSharp or PDFSharp. Looking for VB only not web or ASPX .. Please send a link..thank you
VB export Gridview to PDF
Collapse
X
-
Tags: None
-
Trying to convert from C# to VB , stuck on this lineCode:Dim doc As New Document(iTextSharp.text.PageSize.A4, 10.0F, 10.0F, 10.0F, 10.0F) Dim PdfPTable As PdfPTable = New PdfPTable(DataGridView1.Columns.Count) If (j < DataGridView1.Columns.Count) Then j = +1 PdfPTable.AddCell(DataGridView1.Columns(j).HeaderText) If (i < DataGridView1.Rows.Count) Then i = +1 If (k < DataGridView1.Columns.Count) Then k = +1 [B]If DataGridView1(k, i).Value != null Then[/B] PdfPTable.AddCell(DataGridView1(k, i).Value.ToString()) doc.Add(PdfPTable) doc.Close() -
I use this tool to convert between C# and VB.NET: Convert C# to VB.NET.
It doesn't always get things 100% and I think it has some issues regarding lambda expressions but it usually gets me to a point where I can figure it out.
Which line are you stuck on?
I thought you were attempting to accomplish this using VB classic code?
-FrinnyComment
-
I am trying to convert C# example, but not having much luckCode:If DataGridView1(k, i).Value != null Then PdfPTable.AddCell(DataGridView1(k, i).Value.ToString())
!= null cant be used in VB or Null , The orginal statement
was For not if
Yes classic code, but cant find examples...Comment
Comment