Home arrow Techie/Webby Stop arrow Crystal Reports and VB.Net
Crystal Reports and VB.Net PDF Print E-mail
Wednesday, 06 February 2008

 

Luckily, you do not have to get a separate installation for Crystal Report in Visual Studio 2005. Finally, they have included the application in their software (what's a system if you cannot generate a report from it, right?). Crystal Report 10.2 is the version that goes with it. 

Scenario 1:  Page Orientation

This is simple. I was just trying to adjust my page from portrait to landscape orientation. I usually work with portrait orientation hence I am not aware that it could not be set from its Page Setup. So there, I tried searching and searching until I stumbled on this phrase somewhere:

In crystal Reports, u will find that in menu: File >> Printer SetUp

Printer Setup! That's where it is! Duh! Oh well, anyway, in VS2005, it is located in the menu:

Crystal Reports >> Design >> Printer Setup

You have to select from the list of printers to enable the landscape option. Now I can go on with my second scenario. This time, in coding.


Scenario 2: 
CR's Parameter Dialog Box kept on popping up!

No errors found in my codes. Only problem is, the parameter dialog box of Crystal Report keeps on popping up and asking me to enter the parameters again, when I have already passed it from my code (yes I am using Stored Procedures):

    Dim cmd As New SqlCommand
    With cmd
            .Connection = gConnection
            .CommandType = CommandType.StoredProcedure
            .CommandText = "ISDRISApplicantsMain"
            .Parameters.Add(New SqlParameter("@EmployerID", SqlDbType.SmallInt)).Direction = ParameterDirection.Input
            .Parameters.Add(New SqlParameter("@DateFrom", SqlDbType.NVarChar, 10)).Direction = ParameterDirection.Input
            .Parameters.Add(New SqlParameter("@DateTo", SqlDbType.NVarChar, 10)).Direction = ParameterDirection.Input
            .Parameters("@EmployerID").Value = CInt(cmbEmployerID.Text)
            .Parameters("@DateFrom").Value = dtFrom.Text
            .Parameters("@DateTo").Value = dtTo.Text
            .ExecuteNonQuery()
        End With

        Try

            frmCRApplicantsMain.CrystalReportViewer1.ReportSource = c
            frmCRApplicantsMain.Show()

        Catch ex As Exception
            MsgBox("ex.String")
        End Try

 Any idea how I can go around this? Help! This is my first report out of 30, I guess. Cry

 

 

 

 

 
< Prev   Next >