Click here to Skip to main content
15,888,080 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This are the lines of my code

C#
Public Class Test2
    Protected ConnString As String = "Provider=SQLOLEDB.1;Initial Catalog=Enrollment_Net10;Data Source=.;User Id=sa;Password=;"
    Dim imgName As String
    Dim daImage As OleDbDataAdapter
    Dim dsImage As DataSet
    Dim Crpt As New CrystalDecisions.Windows.Forms.CrystalReportViewer
    Dim crviewer As New CrystalDecisions.Windows.Forms.CrystalReportViewer
    Dim DB As OleDbConnection


 Private Sub BtnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPrint.Click

        Dim Conn As New OleDbConnection(ConnString)
        Conn.Open()
        Dim SQLNo As String = "Select * from StudentRegistration Where AdmissionDate between'" & Me.txtdate1.Text & "' and '" & Me.txtdate2.Text & "'"
        Dim adap As OleDbDataAdapter
        Dim ds As New DataSet
        adap = New OleDbDataAdapter(SQLNo, Conn)

        Me.CrystalReportViewer1.Show()
        Conn.Close()


NB: i want to print the report using 2 date parameters "txtdate1 and txtdate2" and for it to print on my crystal viewer, though ve already designed the report tru crystal report and its returning data. All i need is how to write the code to enable me print from the Application interface.
Posted
Updated 30-Apr-15 8:30am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900