Adding No. Units To Crystal Reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lotus18
    Contributor
    • Nov 2007
    • 865

    Adding No. Units To Crystal Reports

    Hello World

    I have this code that displays this report


    [CODE=vb]
    ...
    With frmSchedules
    rs.Open "Select * From PrintSchedule Where Courses.Title=' " & _
    .lblSection.Cap tion & "' And Sections.Title= '" & .cboSections.Te xt & _
    "' And Semester='" & .cboSemester.Te xt & "'", dbConnection, 1, 1
    End With
    With Report
    .Database.SetDa taSource rs
    .PaperOrientati on = 2
    .PaperSize = 1
    .DiscardSavedDa ta
    End With
    crViewer.Report Source = Report
    crViewer.ViewRe port
    ...
    [/CODE]

    How can I get the current total no of units of the schedule (see image below) Summation of Lec and Lab Units (Total no. of units 31)


  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Insert a new Formula Field and give this in formula editor:

    Sum ({MyTable.Lec}) + Sum ({MyTable.Lab})

    and place this formula wherever required..

    REgards
    Veena

    Comment

    • lotus18
      Contributor
      • Nov 2007
      • 865

      #3
      Originally posted by QVeen72
      Hi,

      Insert a new Formula Field and give this in formula editor:

      Sum ({MyTable.Lec}) + Sum ({MyTable.Lab})

      and place this formula wherever required..

      REgards
      Veena
      Thanks veena, it worked : )

      Comment

      • lotus18
        Contributor
        • Nov 2007
        • 865

        #4
        Hi Veena. I want to make my total no. of units to be fixed format , it show 31.00 instead of 31.0. I tried, Fix(Sum ({MyTable.Lec}) + Sum ({MyTable.Lab}) ,1) and Rnd(Sum ({MyTable.Lec}) + Sum ({MyTable.Lab}) ,1) to the CR's formula, but nothing happens.

        Comment

        • lotus18
          Contributor
          • Nov 2007
          • 865

          #5
          Helloo...

          Can anyone wants to help me. ~_~

          Comment

          • QVeen72
            Recognized Expert Top Contributor
            • Oct 2006
            • 1445

            #6
            Hi,

            Right Click the Formula Field and Click on Format Field
            >> Number Tab
            Customize
            Decimal = 1.0
            Rounding =0.1

            OK and Save

            REgards
            Veena

            Comment

            • lotus18
              Contributor
              • Nov 2007
              • 865

              #7
              Thanks again veena : )

              Comment

              Working...