Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I use something along the lines off:</p> <p>Imports in the class:</p> <pre><code>Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.ReportSource Imports CrystalDecisions.Shared Imports CrystalDecisions.Windows.Forms </code></pre> <p>And then:</p> <pre><code>Private sub print_report() </code></pre> <p>For parameters etc</p> <pre><code> Dim pFields As New ParameterFields() Dim pField As New ParameterField() Dim disVal As New ParameterDiscreteValue() Try Cursor.Current = System.Windows.Forms.Cursors.WaitCursor Dim report_to_print As New report_name </code></pre> <p>add parameters (ignore if not neeeded)</p> <pre><code> report_to_print.SetParameterValue("@parameter", parameter) </code></pre> <p>You also need a form that holds the crystal report viewer control (here frmReportViewer) and pass the report to it (code for this after)</p> <pre><code> Dim frmReportViewer As New frmReportViewer(report_to_print) </code></pre> <p>pass parameters (if required)</p> <pre><code> frmReportViewer.cryrepviewer.ParameterFieldInfo = pFields </code></pre> <p>show report</p> <pre><code> frmReportViewer.ShowDialog() Catch ex As System.Exception 'your own error handling code here Finally Cursor.Current = System.Windows.Forms.Cursors.Default End Try End Sub </code></pre> <p>frmReportViewer - this contains display, saving, printing controls :</p> <pre><code>Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Public Class frmReportViewer Inherits System.Windows.Forms.Form Dim mViewerRep As New ReportDocument Public Sub New(ByVal pViewerRep As ReportDocument) MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call mViewerRep = pViewerRep End Sub Private Sub cryRepViewer_Load() Handles cryrepviewer.Load cryrepviewer.ReportSource = mViewerRep cryrepviewer.Refresh() Me.Text = "" End Sub End Class </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload