Results 1 to 3 of 3

Thread: CR - Want string on my report that says "Displaying 4 of n records"

  1. #1

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,562

    CR - Want string on my report that says "Displaying 4 of n records"

    There's an area on my report where I am limited to displaying up to 4 contacts (that is, a person's name and phone #) and I want a text object saying, for example, "Displaying 4 of 10 contacts" if there's more than 4.

    In C# this would be easy and the spacing between each token would be one space using String.Format().

    I understand CR has no similar function so you have to construct this given what CR supplies. I can't figure out how to have only one space between "10" and "contacts" since 10 is variable and could be 2 or 2000. (Honestly, this total # most likely won't ever be past one digit but it would be nice to code with the flexibility of 4, or more, digits. Because when you write code you want it to work for all situations, past what you're currently working with). So I figured I want to trim, but because it's a number I have to first convert it to a string then trim the string but somehow that gave me decimal places so then I tried to get rid of those by saying ToNumber(count, #)...and it goes on and on with nothing working all that well.

    The problem is really how to position the word "contacts" because that is a text object in a fixed place on the report so all my attempts above aren't the solution.

    What I came up with is "Displaying the first 4 contacts of total " n. Where n can be 2 or 2000 and it won't matter because there's no fixed text afterward. While this is a solution, it just seems stupid and very limiting. *Is* there a way to do what I want?
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  2. #2
    Junior Member
    Join Date
    Feb 2026
    Posts
    19

    Re: CR - Want string on my report that says "Displaying 4 of n records"

    You have one entity - Let's call it 'Person', since you have yet to define. That 'Person' has a one-to-many relationship to another table of 'Contacts', related to that entity. This is just modeling. Not sure yet how complicated this question becomes if you take this into consideration...

  3. #3
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,263

    Re: CR - Want string on my report that says "Displaying 4 of n records"

    Quote Originally Posted by MMock View Post
    There's an area on my report where I am limited to displaying up to 4 contacts (that is, a person's name and phone #) and I want a text object saying, for example, "Displaying 4 of 10 contacts" if there's more than 4.

    In C# this would be easy and the spacing between each token would be one space using String.Format().

    I understand CR has no similar function so you have to construct this given what CR supplies. I can't figure out how to have only one space between "10" and "contacts" since 10 is variable and could be 2 or 2000. (Honestly, this total # most likely won't ever be past one digit but it would be nice to code with the flexibility of 4, or more, digits. Because when you write code you want it to work for all situations, past what you're currently working with). So I figured I want to trim, but because it's a number I have to first convert it to a string then trim the string but somehow that gave me decimal places so then I tried to get rid of those by saying ToNumber(count, #)...and it goes on and on with nothing working all that well.

    The problem is really how to position the word "contacts" because that is a text object in a fixed place on the report so all my attempts above aren't the solution.

    What I came up with is "Displaying the first 4 contacts of total " n. Where n can be 2 or 2000 and it won't matter because there's no fixed text afterward. While this is a solution, it just seems stupid and very limiting. *Is* there a way to do what I want?
    Hmmmm...... ---> https://static.synergetic.net.au/v68...tml/33469.html

    I see a "Count"-Function, and the spacing is simple concatenation: --> ".... of '+Count({MyTable.MyContact})+' contacts'......"
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

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