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

Video; Grouping on Grids

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

    Video; Grouping on Grids

    to get this out of the way, the video will be coming soon but here is a preview Image and the required code.

    Turns out that grouping on grids is really easy to do with the new row events (Thank you Alpha / Selwyn)

    First: the grid have to be ordered by the field you want to group by (the field can be hidden )

    Next: on the OnExistingRowRender event you will put some xbasic similar to this:
    Code:
    function OnExistingRowRender as v (e as p)
    
    'Variables
    if eval_valid("e.rtc.Grupo")=.f. 'if e.rtc.Grupo hasnt been set (eg. first row)
    	e.rtc.Grupo = "$nada$" 'set to a dummy value
    end if
    Grupo_old = e.rtc.Grupo 'The Grouping field value from the previous record 
    Grupo_new = e.rowData.data("Grupo_Acti") 'The Grouping field value from the current record 
    
    'If the current record and the previous are different write this html
    IF Grupo_new  <> Grupo_old
    	e.htmlPrefix = <<%html%
    	<tr bgcolor="#ffffc0">
    	<td colspan="10">
    	<font color=#CC0000 size=3  >%html%+Grupo_New+<<%html%
    	</font>
    	</td>
    	</tr>
    	%html%
    END IF
    
    'Store Current filed value to e.rtc.Grupo so it can be used for the next record
    e.rtc.Grupo = Grupo_new
    
    end function
    the next step would be to get a summary row after each Group and maybe this can be modified to dynamical group rows by the field that the grid is ordered by (that would be so cool)

    Hope you like it
    Last edited by mmaisterrena; 05-25-2010, 02:51 AM.
    Cheers
    Mauricio


    #2
    Re: Video; Grouping on Grids

    Now that is useful stuff! Thanks Mauricio and Selwyn.
    -Steve
    sigpic

    Comment


      #3
      Re: Video; Grouping on Grids

      Nice. Thanks

      Comment


        #4
        Re: Video; Grouping on Grids

        BTW, For those who are not into xbasic I made this code in such a way that you have to only replace the word "Grupo_Acti" by any of the field names on your grid and that will make this work for you, so is as easy as copy-paste (remember to order your grid by the same field name for this to work properly)
        Cheers
        Mauricio

        Comment


          #5
          Re: Video; Grouping on Grids

          I have improved the code to be simpler to use but im still trying to get totals working, this is the updated code now you can customize the "Group band" by only modifying the variables in the "User variables" section of the code (in red)

          Code:
          function OnExistingRowRender as v (e as p)
          
          [COLOR="Red"]'---User Custom Variables, 'just modify this part'---
          Group_By = "Grupo_Acti" 'Field Name you want to group the grid by
          Title_BgColor = "#333333" 'Group Title BackGround color
          Title_TxtColor = "#ffffff" 'Group Title text color
          Title_TxtSize = "3" 'Group Title text size
          colspan= "9" 'Number of columns the groping row will use
          
          ''''''''''''''''''''''''''''''''''''''''''''''''''''''[/COLOR]
          
          
          'Script Variables
          if eval_valid("e.rtc.Group")=.f. 'if e.rtc.Grupo hasnt been set (eg. first row)
          	e.rtc.Group = "$nada$" 'set to a dummy value
          end if
          Group_old = e.rtc.Group 'The Grouping field value from the previous record 
          Group_new = e.rowData.data(Group_By) 'The Grouping field value from the current record 
          Group_Title = Group_New 'Label that will get diplay in the Group Title (Normaly the same field as 'Group_by')
          
          'If the current record and the previous are diferent write this html
          IF Group_new  <> Group_old
          	e.htmlPrefix = <<%html%
          	<tr bgcolor=%html%+Title_BgColor+<<%html%
          	>
          	<td colspan=%html%+colspan+<<%html%
          	>
          	<font color=%html%+Title_TxtColor+<<%html%
          	 size="%html%+Title_TxtSize+<<%html%
          	" ><strong>%html%+Group_title+<<%html%
          	</strong></font>
          	</td>
          	</tr>
          	%html%
          END IF
          
          'Store Current filed value to e.rtc.Grupo so it can be used for the next record
          e.rtc.Group = Group_new
          
          end function
          Cheers
          Mauricio

          Comment


            #6
            Re: Video; Grouping on Grids

            Finally I was able to come up with this ugly code, that has totals but it will only work correctly when the grid is set to display all records, Although Filtering (searching) records will result in Correct calculations as long as all resulting records are displayed (In properties yo can set "Rows of data to 0 to display all records)


            function OnExistingRowRender as v (e as p)


            '---User Custom Variables, 'just modify this part'---
            Group_By = "Grupo_Acti" 'Field Name you want to group the grid by
            Title_BgColor = "#333333" 'Group Title BackGround color
            Title_TxtColor = "#ffffff" 'Group Title text color
            Title_TxtSize = "3" 'Group Title text size
            colspan= "8" 'Number of columns the groping row will use

            Totals_BgColor = "#808080" 'Group Totals BackGround color
            Totals_TxtColor = "#ffffff" 'Group Totals text color
            Totals_TxtSize = "2" 'Group Totals text size
            Count_label = "Count: "
            Total1_Field="Costo_prog"
            Total1_label= "Total: "

            ''''''''''''''''''''''''''''''''''''''''''''''''''''''

            'debug(1)

            'Script Variables

            if if e.rowNumber = 1 'if e.rtc.Grupo hasnt been set (eg. first row)
            e.rtc.Group = "$nada$" 'set to a dummy value
            e.rtc.Count = 0
            e.rtc.Total1 = 0
            e.rtc.Reset = "No"
            e.rtc.value1=0
            end if

            Group_old = e.rtc.Group 'The Grouping field value from the previous record
            Group_new = e.rowData.data(Group_By) 'The Grouping field value from the current record
            Count_Records = e.rtc.Count + 1
            Group_Title = Group_New 'Label that will get diplay in the Group Title (Normaly the same field as 'Group_by')
            Total1_Current = e.rowData.data(Total1_Field)
            Total1 = e.rtc.Total1 + e.rtc.value1

            'sql_where = e.rtc.sql_where

            'If the current record and the previous are diferent write this html

            IF Group_new <> Group_old
            e.htmlPrefix = <<%html%
            <tr bgcolor=%html%+Title_BgColor+<<%html%
            >
            <td colspan=%html%+colspan+<<%html%
            >
            <font color=%html%+Title_TxtColor+<<%html%
            size="%html%+Title_TxtSize+<<%html%
            " ><strong>%html%+Group_title+<<%html%
            </strong></font>
            </td>
            </tr>%html%

            IF e.rowNumber <> 1 ' IF this is not the first record
            Totals_band = <<%html%
            <tr bgcolor=%html%+Totals_BgColor+<<%html%
            >
            <td colspan=%html%+colspan+<<%html%
            >
            <font color=%html%+Totals_TxtColor+<<%html%
            size="%html%+Totals_TxtSize+<<%html%
            " >
            <strong>
            %html%+Count_label + Count_Records + ", "+ Total1_label + Total1 + <<%html%
            </strong>
            </font>
            </td>
            </tr>

            <tr>
            <td height="10px">
            </td>
            </tr>%html%
            e.htmlPrefix = Totals_band + e.htmlPrefix
            END IF
            Count_Records = 0
            if e.rowNumber <> 1
            e.rtc.Reset="Yes"
            end if
            Else
            e.rtc.Reset="No"
            END IF



            IF e.rtc.recordsInQuery = e.rowNumber ' For the very last totals band
            Totals_band = <<%html%
            <tr bgcolor=%html%+Totals_BgColor+<<%html%
            >
            <td colspan=%html%+colspan+<<%html%
            >
            <font color=%html%+Totals_TxtColor+<<%html%
            size="%html%+Totals_TxtSize+<<%html%
            " ><strong>
            %html%+ Count_Label +(Count_Records+1) + ", "+ Total1_label + Total1 +<<%html%
            </strong>
            </td>
            </tr>

            <tr>
            <td height="10px">
            </td>
            </tr>%html%
            e.htmlSuffix= Totals_band

            end if

            if e.rtc.Reset="Yes"
            Total1=0
            end if
            'Store Current filed value to e.rtc.Grupo so it can be used for the next record
            e.rtc.Group = Group_new
            e.rtc.Count = Count_Records
            e.rtc.Total1 = Total1
            e.rtc.value1 = e.rowData.data(Total1_Field)
            end function
            Feel free to contribute

            Edit: there still some errors in totals when filtering in certain situations
            Last edited by mmaisterrena; 05-26-2010, 03:49 AM.
            Cheers
            Mauricio

            Comment


              #7
              Re: Video; Grouping on Grids

              Mauricio,

              This looks great, I tried adapting the code to my needs but have been unsuccessful so far, Im no programmer!.

              Code:
              '---User Custom Variables, 'just modify this part'---
              Group_By = "assigned_to" 'Field Name you want to group the grid by
              Title_BgColor = "#333333" 'Group Title BackGround color
              Title_TxtColor = "#ffffff" 'Group Title text color
              Title_TxtSize = "3" 'Group Title text size
              colspan= "7" 'Number of columns the groping row will use
              
              Totals_BgColor = "#808080" 'Group Totals BackGround color
              Totals_TxtColor = "#ffffff" 'Group Totals text color
              Totals_TxtSize = "2" 'Group Totals text size
              Count_label = "Count: "
              'Total1_Field="assigned_to"
              'Total1_label= "Total: "
              I have a grid with 7 columns
              ID
              Priority
              Severity
              State
              Headline
              Assigned_To
              Release_Target

              I would like to have it in 5 separate grids covering all except the id and the headline columns, all I need is a count, there are no costs involved (at present. Which bits of the code do I need to change to take out the count?

              Any help greatly appreciated.

              Regards
              Andy

              Comment


                #8
                Re: Video; Grouping on Grids

                Try this (I removed the Summing part):

                function OnExistingRowRender as v (e as p)


                '---User Custom Variables, 'just modify this part'---
                Group_By = "assigned_to" 'Field Name you want to group the grid by
                Title_BgColor = "#333333" 'Group Title BackGround color
                Title_TxtColor = "#ffffff" 'Group Title text color
                Title_TxtSize = "3" 'Group Title text size
                colspan= "8" 'Number of columns the groping row will use

                Totals_BgColor = "#808080" 'Group Totals BackGround color
                Totals_TxtColor = "#ffffff" 'Group Totals text color
                Totals_TxtSize = "2" 'Group Totals text size
                Count_label = "Count: "
                'Total1_Field=""
                'Total1_label= "Total: "

                ''''''''''''''''''''''''''''''''''''''''''''''''''''''
                'debug(1)

                'Script Variables

                if e.rowNumber = 1 'if e.rtc.Grupo hasnt been set (eg. first row)
                e.rtc.Group = "$nada$" 'set to a dummy value
                e.rtc.Count = 0
                'e.rtc.Total1 = 0
                e.rtc.Reset = "No"
                e.rtc.value1=0
                end if

                Group_old = e.rtc.Group 'The Grouping field value from the previous record
                Group_new = e.rowData.data(Group_By) 'The Grouping field value from the current record
                Count_Records = e.rtc.Count + 1
                Group_Title = Group_New 'Label that will get diplay in the Group Title (Normaly the same field as 'Group_by')
                'Total1_Current = e.rowData.data(Total1_Field)
                'Total1 = e.rtc.Total1 + e.rtc.value1

                'sql_where = e.rtc.sql_where

                'If the current record and the previous are diferent write this html

                IF Group_new <> Group_old
                e.htmlPrefix = <<%html%
                <tr bgcolor=%html%+Title_BgColor+<<%html%
                >
                <td colspan=%html%+colspan+<<%html%
                >
                <font color=%html%+quote(Title_TxtColor)+<<%html%
                size="%html%+Title_TxtSize+<<%html%
                " ><strong>%html%+Group_title+<<%html%
                </strong></font>
                </td>
                </tr>%html%

                IF e.rowNumber <> 1 ' IF this is not the first record
                Totals_band = <<%html%
                <tr bgcolor=%html%+Totals_BgColor+<<%html%
                >
                <td colspan=%html%+colspan+<<%html%
                >
                <font color=%html%+quote(Totals_TxtColor)+<<%html%
                size="%html%+Totals_TxtSize+<<%html%
                " >
                <strong>
                %html%+Count_label + Count_Records + <<%html%
                </strong>
                </font>
                </td>
                </tr>

                <tr>
                <td height="10px">
                </td>
                </tr>%html%
                e.htmlPrefix = Totals_band + e.htmlPrefix
                END IF
                Count_Records = 0
                if e.rowNumber <> 1
                e.rtc.Reset="Yes"
                end if
                Else
                e.rtc.Reset="No"
                END IF



                IF e.rtc.recordsInQuery = e.rowNumber ' For the very last totals band
                Totals_band = <<%html%
                <tr bgcolor=%html%+Totals_BgColor+<<%html%
                >
                <td colspan=%html%+colspan+<<%html%
                >
                <font color=%html%+quote(Totals_TxtColor)+<<%html%
                size="%html%+Totals_TxtSize+<<%html%
                " ><strong>
                %html%+ Count_Label +(Count_Records+1) +<<%html%
                </strong>
                </td>
                </tr>

                <tr>
                <td height="10px">
                </td>
                </tr>%html%
                e.htmlSuffix= Totals_band

                end if

                if e.rtc.Reset="Yes"
                'Total1=0
                end if
                'Store Current filed value to e.rtc.Grupo so it can be used for the next record
                e.rtc.Group = Group_new
                e.rtc.Count = Count_Records
                'e.rtc.Total1 = Total1
                'e.rtc.value1 = e.rowData.data(Total1_Field)
                end function
                Be sure to clear out all the code and text currently on that event before pasting
                Remember that all records in the grid must be shown , although you can filter it and even search without problems
                Last edited by mmaisterrena; 05-26-2010, 10:08 AM.
                Cheers
                Mauricio

                Comment


                  #9
                  Re: Video; Grouping on Grids

                  Wow,

                  That is just fantastic.


                  Thank you so much, this will save me so much time.

                  Regards
                  Andy

                  Comment


                    #10
                    Re: Video; Grouping on Grids

                    Here is the corrected code It will now totalize correctly even If you make a search on the grid, but it works with both DBF and SQL

                    Remember:
                    The grid have to be ordered by the field you want to group by (the field can be hidden )
                    You have to show all records on grid (Searching is OK, the totals will be recalculated)

                    Code:
                    function OnExistingRowRender as v (e as p)
                    
                    [COLOR="Red"]'---User Custom Variables, 'just modify this part'---
                    Group_By = "Grupo_Acti" 'Field Name you want to group the grid by
                    Title_BgColor = "#333333" 'Group Title BackGround color
                    Title_TxtColor = "#ffffff" 'Group Title text color
                    Title_TxtSize = "3" 'Group Title text size
                    colspan= "10" 'Number of columns the groping row will use
                    
                    Totals_BgColor = "#808080" 'Group Totals BackGround color
                    Totals_TxtColor = "#ffffff" 'Group Totals text color
                    Totals_TxtSize = "2" 'Group Totals text size
                    Count_label = "Count: " 'label that goes betfore the record count number
                    Total1_Field="Costo_prog" ' the field you want to TOTALIZE
                    Total1_label= "Total: $" 'label that goes betfore the TOTALIZED number
                    
                    ''''''''''''''''''''''''''''''''''''''''''''''''''''''[/COLOR]
                    'debug(1)
                    
                    'Script Variables
                    
                    IF e.rowNumber = 1 'IF e.rtc.Grupo hasnt been set (eg. first row)
                    	e.rtc.Group = "$nada$" 'set to a dummy value
                    	e.rtc.Count = 0
                    	e.rtc.Total1 = 0
                    	e.rtc.Reset = "Yes"
                    	e.rtc.Reset_old = "Yes"
                    	e.rtc.value1=0	
                    END IF
                    
                    
                    
                    Group_old = e.rtc.Group 'The Grouping field value from the previous record
                    Group_new = e.rowData.data(Group_By) 'The Grouping field value from the current record
                    IF Group_new <> Group_old
                    	e.rtc.Reset="Yes"
                    ELSE
                     	e.rtc.Reset="No"
                    end if
                    Count_Records = e.rtc.Count + 1
                    Group_Title = Group_New 'Label that will get diplay in the Group Title (Normaly the same field as 'Group_by')
                    Total1_Current = e.rowData.data(Total1_Field)
                    Total1 = e.rtc.Total1 + e.rtc.value1
                    
                    'sql_where = e.rtc.sql_where
                    
                    'If the current record and the previous are diferent write this html
                    
                    '	e.htmlPrefix = <<%html%
                    '	<tr bgcolor="#ffffff"
                    '	>
                    '	<td colspan=%html%+colspan+<<%html%
                    '	>
                    '	<font color="#000000"
                    '	size="%html%+Title_TxtSize+<<%html%
                    '	" ><strong>%html% + "RESET:  "+ e.rtc.Reset +", "+Total1 +<<%html%
                    '	</strong></font>
                    '	</td>
                    '	</tr>%html%
                    
                    
                    IF Group_new <> Group_old
                    	e.htmlPrefix = <<%html%
                    	<tr bgcolor=%html%+Title_BgColor+<<%html%
                    	>
                    	<td colspan=%html%+colspan+<<%html%
                    	>
                    	<font color=%html%+quote(Title_TxtColor)+<<%html%
                    	size="%html%+Title_TxtSize+<<%html%
                    	" ><strong>%html%+Group_title+<<%html%
                    	</strong></font>
                    	</td>
                    	</tr>%html%'+e.htmlPrefix 
                    	
                    	IF e.rowNumber <> 1 ' IF this is not the first record
                    		Totals_band = <<%html%
                    		<tr bgcolor=%html%+Totals_BgColor+<<%html%
                    		>
                    		<td colspan=%html%+colspan+<<%html%
                    		>
                    		<font color=%html%+quote(Totals_TxtColor)+<<%html%
                    		size="%html%+Totals_TxtSize+<<%html%
                    		" >
                    		<strong>
                    		%html%+Count_label + Count_Records + ", "+ Total1_label + alltrim(str(Total1 ,250,2,",")) + <<%html%
                    		</strong>
                    		</font>
                    		</td>
                    		</tr>
                    		
                    		<tr>
                    		<td height="10px">
                    		</td>
                    		</tr>%html%
                    		e.htmlPrefix = Totals_band + e.htmlPrefix
                    	END IF
                    	Count_Records = 0
                    	Reset="Yes"
                    	IF e.rtc.recordsInQuery = e.rowNumber
                    		Total1=0
                    	End if
                    ELSE
                    	Reset="No"
                    END IF
                    
                    
                    
                    IF e.rtc.recordsInQuery = e.rowNumber ' For the very last totals band
                    	Totals_band = <<%html%
                    	<tr bgcolor=%html%+Totals_BgColor+<<%html%
                    	>
                    	<td colspan=%html%+colspan+<<%html%
                    	>
                    	<font color=%html%+quote(Totals_TxtColor)+<<%html%
                    	size="%html%+Totals_TxtSize+<<%html%
                    	" ><strong>
                    	%html%+ Count_Label +(Count_Records+1) + ", "+ Total1_label + alltrim(str((Total1+Total1_Current) ,250,2,",")) +<<%html%
                    	</strong>
                    	</td>
                    	</tr>
                    	
                    	<tr>
                    	<td height="10px">
                    	</td>
                    	</tr>%html%
                    	e.htmlSuffix= Totals_band
                    	
                    END IF
                    
                    
                    IF e.rtc.Reset="Yes" 
                    	Total1=0
                    END IF
                    
                    'Store Current filed value to e.rtc.Grupo so it can be used for the next record
                    e.rtc.Group = Group_new
                    e.rtc.Count = Count_Records
                    e.rtc.Total1 = Total1
                    e.rtc.value1 = e.rowData.data(Total1_Field)
                    e.rtc.Reset = Reset
                    END FUNCTION
                    Last edited by mmaisterrena; 05-26-2010, 01:48 PM.
                    Cheers
                    Mauricio

                    Comment


                      #11
                      Re: Video; Grouping on Grids

                      Thank you very much for sharing this code.

                      Comment


                        #12
                        Re: Video; Grouping on Grids

                        Just wanted to say that I've been looking for ways to do this since I started with Alpha last year, and if people have figured this out before, I'm pretty confident the code's not on the forum, so thanks so so much for sharing and making it so easy to adapt.

                        I've got a question that's probably data type/syntax related but I haven't yet figured out. I adapted your code to produce multiple totals in the totals band, and it works beautifaully for the most part. However, I'm pulling counts from a SQL view, so where there is no value, it's not adding that column. In the attached pic, The row with "Lisa" appears because there's someone in her Pending Caseload, but the "Caseload", "Coverage", and "Total" Totals don't work because of the non-values in that row. I've tried formatting the values to be a 0 but that didn't work; I also tried including a calculated field to show the 0 value if it's blank which displays correctly but didn't work for the Totals band.

                        Thanks again so much for getting me this far, and this is the only snag I've found even in making modifications to your code.

                        Comment


                          #13
                          Re: Video; Grouping on Grids

                          Hi Chris, im always happy to help and glad it was useful for you

                          about your problem try adding a calculated field (you dont have to do this at table level you can add it in alpha by adding an expression to the query definition) the field should put a "1" on the rows that are "caseload coverage" and 0 where it isnt and instead of counting them sum them (use the Total1_Field) that should work in theory (is this what you already tried?)
                          Cheers
                          Mauricio

                          Comment


                            #14
                            Re: Video; Grouping on Grids

                            I re-read your problem. and think i got ya now
                            try changing this line almost at the end of the code

                            e.rtc.value1 = e.rowData.data(Total1_Field)

                            to this:

                            e.rtc.value1 = val(e.rowData.data(Total1_Field))

                            or

                            e.rtc.value1 = convert_type(e.rowData.data(Total1_Field),"n")
                            Cheers
                            Mauricio

                            Comment


                              #15
                              Re: Video; Grouping on Grids

                              Actually, I got it working properly with the in-query expressions.

                              Really pleased with it, and I intend to dig into the code a bit more later to do some more with it.

                              Thanks again.

                              Comment

                              Working...
                              X