CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2001
    Posts
    254

    basic syntax what does it mean

    Dim Report As New CrystalReport36
    Dim strselectionformula As String
    Dim vReconDate As Date
    Private Sub Form_Load()
    vReconDate = CDate(Daily_Route_Recon.MaskEdBox1(0).Text)
    Report.ReportTitle = Daily_Route_Recon.MaskEdBox1(0).Text
    Report.DiscardSavedData
    strselectionformula = " {DailyRouteReconciliation.RECONDATE} =#" & vReconDate & "#"
    Report.RecordSelectionFormula = strselectionformula
    Screen.MousePointer = vbHourglass
    CRViewer1.ReportSource = Report
    CRViewer1.ViewReport
    Screen.MousePointer = vbDefault
    End Sub

    Private Sub Form_Resize()
    CRViewer1.Top = 0
    CRViewer1.Left = 0
    CRViewer1.Height = ScaleHeight
    CRViewer1.Width = ScaleWidth

    End Sub

    this is the result.....

    "BASIC SYSNTAX IS NOT SUPPORTED IN GROUP OR RECORD SELECTION FORMULA"

    any suggestions ?

    thnks
    cyrus

  2. #2
    Join Date
    Jul 2005
    Posts
    1,083

    Re: basic syntax what does it mean

    It means that you can set 2 kind of formulaes syntax in CR : CR syntax or VB syntax
    Then, You have to supply the formula using CR syntax
    There are several ways to do it, here's one :
    Code:
    'Variables already declared as integer
    MyM = Month(vReconDate)
    MyD = Day(vReconDate)
    MyY = Year(vReconDate)
    
    strselectionformula = "{DailyRouteReconciliation.RECONDATE} =Date(" & Format(MyY) & "," & Format(MyM) & "," & Format(MyD) & ")"
    Or set the CR report to use VB syntax and use VB syntax
    Last edited by jggtz; April 26th, 2009 at 12:58 AM.

  3. #3
    Join Date
    Sep 2001
    Posts
    254

    Re: basic syntax what does it mean

    how can i set CR to VB syntax

  4. #4
    Join Date
    Jul 2005
    Posts
    1,083

    Re: basic syntax what does it mean

    You didn't say CR version, but in CR 10 you can set Formula Language in
    Menu/File/Options/Reporting/Formula Language
    Could be Crystal syntax or Basic syntax

  5. #5
    Join Date
    Aug 2007
    Posts
    180

    Re: basic syntax what does it mean

    No matter how you set the formula languge, the record selection and group selection formulae must be in Crsytal Syntax. Basic syntax is not supported for these two formulae.

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

Featured