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

  • SEARCH
  • Home
  • 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 528779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:01:20+00:00 2026-05-13T09:01:20+00:00

My report Groups by two fields, the second being a date field. If I

  • 0

My report Groups by two fields, the second being a date field.

If I go to ‘Group Expert’, select the second field (the date field), and click Options, I get the ‘Change Group Options’ dialog. There are two tabs (Common and Options), on the Common tab we now see three comboboxes.

Combobox1: The Date field

Combobox2: in ascending order.

And the third comobox, which exists because this is a date field, has this label above it:
“The section will be printed:”

And its value is:

Combobox3: for each day.

OK. In my Formula Editor, I need to sum a field (within our group by field), so my formula looks like this:

Sum({Table.Field}, {Table.OurDateFieldWeAreGroupingOn}, "daily")

Daily is there because Group Expert is “for each day”. If I change ComboBox3 to “for each month”, the string in the Sum function would have to change to “monthly”. The Sum function is there so that I have a running total every time crystal reports breaks on my grouping.

The issue I am running into is the string condition. This is because I want to be able to change the grouping at runtime.

For example,

switch (grouping)
{
    case Minute:
        m_Rpt.DataDefinition.Groups[1].GroupOptions.Condition = 9;
        break;
    case Hour:
        m_Rpt.DataDefinition.Groups[1].GroupOptions.Condition = 10;
        break;
    case Day:
        m_Rpt.DataDefinition.Groups[1].GroupOptions.Condition = 0;
        break;
    case Week:
        m_Rpt.DataDefinition.Groups[1].GroupOptions.Condition = 1;
        break;
    // etc, etc, etc
}

So, they allow me to change the grouping at runtime, no problem. At design-time I had “daily”, but I could make it “monthly” (for example). Btw, does anybody know if I can replace the 9, 10, 0, 1, etc. with some Crystal Reports defines (something from an enum or something)? I only figured out that “weekly was 1” (for example) because that was the 2nd item in “combobox3”.

Being that I can change this at runtime? How the heck can I modify the condition of my formula?

If I changed it, at runtime, to weekly, I’d need my Sum to look like this:

Sum({Table.Field}, {Table.OurDateFieldWeAreGroupingOn}, "weekly")

The problem is that in the field editor, if I use anything other than a string, I get this error: “A group condition must be a string”. I had tried to pass that string as a value (for example):

Sum({Table.Field}, {Table.OurDateFieldWeAreGroupingOn}, {@ValuePassedIn})

I mean, if they allow you to change the grouping at runtime, I have to be able to change the conditions of the formulas too, right?

  • 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-05-13T09:01:20+00:00Added an answer on May 13, 2026 at 9:01 am

    I’m basically learning Crystal Reports on the fly, so some things might escape me at the moment … that being said:

    The Sum field was originally used because I needed to maintain a “running total” every time that the page breaks on my grouping. Well, I went ahead and crated a “Running Total” field (which doesn’t require me to specify daily or weekly or monthly). Then, in my formula, I used this new Running Total field instead of the Sum function (they both did the same thing).

    Problem solved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 476k
  • Answers 476k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Doesn't look like you ever ended your application:didFinishLaunchingWithOptions: method -… May 16, 2026 at 4:46 am
  • Editorial Team
    Editorial Team added an answer Continuing from Joshua's answer, the plyr function to use is… May 16, 2026 at 4:46 am
  • Editorial Team
    Editorial Team added an answer The KeyError exception you see when you connect directly is… May 16, 2026 at 4:46 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.