Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Search & format specific [Capitilised] text in a table layout report "Text" field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Search & format specific [Capitilised] text in a table layout report "Text" field

    Hi,

    Me again. This time with something I think should be much easier.

    I need to search for the following in a table layout report field set wrapped. [Not HTML];

    A "text" field for all CAPITILISED text WHERE caps characters are 3 and more [In the same word with no spaces between the characters]

    I.e.

    You may choose an icon for your MESSAGE from this list.

    The requirement is to format the capital word to bold

    You may choose an icon for your MESSAGE from this list.

    #2
    Re: Search & format specific [Capitilised] text in a table layout report "Text" field

    Any reason why it can't be in an HTML field? You could then use an xbasic function to insert tags around specific words (either <b> or <span class="...">, say).

    Comment


      #3
      Re: Search &amp; format specific [Capitilised] text in a table layout report &quot;Text&quot; field

      Perhaps something like this:

      Code:
      FUNCTION count_caps AS N (word AS C )
      	'Count the number of capital letters in word
      	dim char as C
      	dim pos as N
      	
      	word = remspecial(word)
      	
      	for pos = 1 to len(word)
      		char = substr(word,pos,1)
      		if *first(alltrim(char), UPPER(char)) = .T. then
      			count_caps = count_caps + 1
      		end if			
      	next	
      	
      END FUNCTION
      
      
      FUNCTION tag_caps AS C (string AS C, mincaps AS N = 1, openingtag AS C = "<b>", closingtag AS C = "</b>")
      	'Insert tags around any letters which contains more than the specified number of capital letters
      	dim curr_word AS C
      	
      	list = strtran(string," ", crlf())
      	
      	for each curr_word in list			
      		tag_caps = tag_caps + if(count_caps(curr_word) >= mincaps, openingtag + curr_word + closingtag, curr_word) + " "				
      	next
      	
      	tag_caps = alltrim(tag_caps)
      	
      END FUNCTION
      Probably a little overcomplicated, but it deals with special characters and allows you to specify your own html tags and minimum caps count.

      Example usage:
      Code:
      ?tag_caps("THIS is sOME SAMPle TExt!",3)
      = "<b>THIS</b> is <b>sOME</b> <b>SAMPle</b> TExt!"
      
      ?tag_caps("THIS is sOME SAMPle TExt!",4,"<span class=\"special\">","</span>")
      = <span class="special">THIS</span> is sOME <span class="special">SAMPle</span> TExt!

      Comment


        #4
        Re: Search &amp; format specific [Capitilised] text in a table layout report &quot;Text&quot; field

        Rohan,

        Thanks, question;

        The "capitalised word' is random, never or rather, almost never the same. This means I will have to search the entire "text area" html field for ANY occurrence where a specific word starts with and have at least caps for the 1st 3 letters. I then assume the whole word SHOULD be caps and it should be changed to Bold then.

        I have never even came close to something like this before so your help is appreciated.

        Field = "Info"
        Field Type [SQL = text], [Alpha = Textarea]
        Report field type HTML [as you suggested]

        Comment


          #5
          Re: Search &amp; format specific [Capitilised] text in a table layout report &quot;Text&quot; field

          Hi Cornelius,

          That should be fine - the tag_caps function loops through all the words in the input string and only inserts tags around the ones that contain more than a specified number of caps (1 by default, but it's an optional parameter). The example above shows it working on a fixed string, but to use it on the 'Info' field you'd create a calculated expression like:
          Code:
          formattedtext = printHTML(tag_caps(Info,3))
          then place the 'formattedtext' placeholder in your HTML field. That should give you what you're after.

          Comment


            #6
            Re: Search &amp; format specific [Capitilised] text in a table layout report &quot;Text&quot; field

            Originally posted by roe3p View Post
            Hi Cornelius,

            That should be fine - the tag_caps function loops through all the words in the input string and only inserts tags around the ones that contain more than a specified number of caps (1 by default, but it's an optional parameter). The example above shows it working on a fixed string, but to use it on the 'Info' field you'd create a calculated expression like:
            Code:
            formattedtext = printHTML(tag_caps(Info,3))
            then place the 'formattedtext' placeholder in your HTML field. That should give you what you're after.
            Rohan, I am wonderfully idiotic with this. Ha Ha [Laughing at myself]

            I tried your code, used code editor to create the function, tried to call it in the report but NO, its nowhere to be found. Miserable failure from my side. Just don't know/understand enough of this.

            It seemed so simple to me. Search and html field for any word that starts with a capital letter and have at least 3 capitals from the start of the word. Bold this word if true. Ha... Easier said than done.

            Can I create this function in the report itself?

            Comment


              #7
              Re: Search &amp; format specific [Capitilised] text in a table layout report &quot;Text&quot; field

              No worries, I'm still a bit of a newbie with reports so constantly encountering problems that mystify me for days! :-)

              I'm not sure how you're calling the function, but once it's defined in the Control Panel -> Code section it should be available to your reports.

              Have you defined an expression in your Calculated Fields window? (the xy icon in the toolbar) That will let you call all xbasic functions available to you, both built-in and custom:
              Screenshot - calc fields.png

              Once you've defined the expression, you should be able to select it in your field list, as though it were a field from your dataset:
              Screenshot - calc fields 2.png

              That works for me - here's the expression as it appears on the report:
              Screenshot - tag_caps.png

              If you still have problems, can you post a screenshot of how you're trying to use the function/expression?

              Thanks!

              Comment

              Working...
              X