vsprinter.RenderControl not working.

Originally Posted 11 August 2012, 10:57 am EST

  • Originally Posted 11 August 2012, 10:57 am EST

    Hi,

    I am trying to print a flexgrid using vsprinter. Trying to do the same using "vsprinter.rendercontrol" mechanism.

    Output in preview panel of printer is always blank.

    Please suggest what is missing in below code:


    Public Class frmPrinter

    Private Sub frmPrinter_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    Me.cfgData.DataSource = GetData().Tables(0)

    End Sub

    Private Function GetData() As DataSet

    Dim ds As DataSet = New DataSet

    Dim dt As DataTable = New DataTable

    dt.Columns.Add("Name")

    Dim dr As DataRow = dt.NewRow()

    dr("Name") = "Test"

    dt.Rows.Add(dr)

    ds.Tables.Add(dt)

    Return ds

    End Function

    Private Sub btnRender_Click(sender As System.Object, e As System.EventArgs) Handles btnRender.Click

    Me.cvpData.StartDoc()

    Me.cvpData.RenderControl = Me.cfgData.Handle.GetHashCode

    Me.cvpData.EndDoc()

    End Sub

    End Class
  • Reply

    In the sub routine btnRender_Click, tried the following line as well without any luck:

    Me.cvpData.RenderControl = Me.cfgData.Handle

    Please help.

    Thanks.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels