Results 1 to 6 of 6

Thread: [RESOLVED] Two Dates Parameter

  1. #1

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Resolved [RESOLVED] Two Dates Parameter

    Hi! Im using CR9 and new to it. I have tried creating a report that will display client records. I want to generate a monthly reports so I need to use Start and End Date. My problem is, How do I let CR know that I just want to display records between the two dates? Is this done in CR alone or there is a code or controls needed in VB?

    An example is highly appreciated and thank you very much in advance!
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  2. #2
    Junior Member
    Join Date
    Aug 2007
    Posts
    20

    Re: Two Dates Parameter

    report.recordselection = " {NameOfTable.FieldName} => #" & UrStartDate & _
    "# AND {NameOfTable.FieldName} <= #" & UrEndDate & "#"

  3. #3

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: Two Dates Parameter

    are there controls i need to add in the vbform?
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  4. #4

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: Two Dates Parameter

    I have created a report which display the transactions by client just like in the attached file. But I want it to be dynamic. The user enters the start and end date (as well as the month and the year, if needed), after entering, the report should display the results.

    An example program is highly appreciated. Thanks in advance!
    Attached Images Attached Images  
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  5. #5
    New Member
    Join Date
    Oct 2007
    Posts
    6

    Re: Two Dates Parameter

    What code are you using to bring up the crystal report now?

    I mean, basically all you have to do is either use an input box command and get the month then use that variable in the query or create a vb form that asks them for a date range and plug that into your query.

  6. #6

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: Two Dates Parameter

    this is what i have so far
    Code:
    Option Explicit
    
    Private Sub cmdClose_Click()
      Unload Me
    End Sub 'cmdClose_Click
    
    Private Sub Form_Load()
      Dim cReport As CRAXDRT.Report
      Dim cAppn As New CRAXDRT.Application
      
      Call openConnection
      
      Me.Left = LeftPos - 440
      Me.Top = TopPos - 1100
    
      Screen.MousePointer = vbHourglass
      Set cReport = cAppn.OpenReport(App.Path & "\SuppliesConsumptionReport.rpt")
      CRViewer91.ReportSource = cReport
      CRViewer91.ViewReport
      Screen.MousePointer = vbDefault
      
      Set cReport = Nothing
      Set Appn = Nothing
      
    End Sub 'Form_Load
    When i run the proj., it ask me to enter the value for the parameters month, year and dates. I have put two DTPicker in the VB form so thats instead of the prog will ask those mentioned, I want to pass the value of DTPicker as values of the parameters.
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width