Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8989485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:16:16+00:00 2026-06-15T22:16:16+00:00

I have write code to display data using crystal reports. I have set parameter

  • 0

I have write code to display data using crystal reports. I have set parameter fields but it seems like it’s not functioning well. Here is an example:

Database

   1/12/2012        A
   5/12/2012        B
   9/12/2012        C
   13/12/2012       D

Conditions used to display report:
Start date = 1/12/2012
End date = 15/12/2012

Here it just displays data for 13/12/2012 - D but with

Start date = 1/12/2012
End date = 9/12/2012

it displays all the data:

   1/12/2012-A
   5/12/2012-B
   9/12/2012-C
   13/12/2012-D

Here is my vb.net code:

    Dim reader As OleDbDataReader = myCommand.ExecuteReader
    If reader.Read = True Then
        cryRpt = New ReportDocument()
        cryRpt.Load("C:\Users\user\Documents\LabSystem\LabSystem\Report\Spec.rpt")

        crParameterDiscreteValue.Value = txtDateFrom.Text
        crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
        crParameterFieldDefinition = crParameterFieldDefinitions("fromDate")
        crParameterValues = crParameterFieldDefinition.CurrentValues

        crParameterValues.Clear()
        crParameterValues.Add(crParameterDiscreteValue)
        crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

        crParameterDiscreteValue.Value = txtDateTo.Text
        crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
        crParameterFieldDefinition = crParameterFieldDefinitions("toDate")
        crParameterValues = crParameterFieldDefinition.CurrentValues

        crParameterValues.Add(crParameterDiscreteValue)
        crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

        CrTables = cryRpt.Database.Tables
        Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
        For Each crTable In CrTables

            crtableLogoninfo = crTable.LogOnInfo
        Next
        crtableLogoninfo.ConnectionInfo = crConnectionInfo
        crTable.ApplyLogOnInfo(crtableLogoninfo)


        CrystalReportViewer1.ReportSource = cryRpt
        CrystalReportViewer1.RefreshReport()

    Else
        MsgBox("No records exists")
    End If
    reader.Close()
Catch ex As Exception
    MsgBox("Error in select query: " + ex.Message)
End Try

Here’s the condition in crystal report:

{1BK.edate}=({?toDate} TO {?fromDate})
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:16:17+00:00Added an answer on June 15, 2026 at 10:16 pm

    I’d try in this order:

    1. Change selection criteria to {1BK.edate} = ({?fromDate} to
      {?toDate})
    2. Change selection criteria to {1BK.edate} >= {?fromDate}
      and {1BK.edate} <= {?toDate}
    3. Change selection criteria to
      {1BK.edate} >= '#' + {?fromDate} + '#' and {1BK.edate} <= '#' +
      {?toDate} + '#'
      (make sure your parameters are strings in this
      instance
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have write this code but it does work only if I am already
I have this code to write to a file, it works perfect but I
Sometimes I have to write code that alternates between doing things and checking for
So far I have managed to write some code that should print the source
I have been trying to write some code in Scala to read a file
when I write Python code from the interpreter I can type dir() to have
I have a text editor in which a user can write HTML code. I
Question simple and quick: I have started to use Netbeans to write some code
I have a couple of web-pages where I write out some code c# ,
I'm trying to write some C# code to do administration on IIS. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.