Print Page | Close Window

GroupFormula

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=18987
Printed Date: 23 November 2024 at 9:42am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: GroupFormula
Posted By: flado
Subject: GroupFormula
Date Posted: 26 September 2011 at 4:58pm
I recently updated to 15.1.3 thinking that it would solve my groupformula problems, but I can't seem to figure it out...

Here are my problems:
1. I use space as thousand separator - ie 1,000 becomes 1 000  - the control doesn't seem to be able to calculate this. Or is there a sepcial formula I should use?
2. I have a report in which I want to show the subsums of up to 12 columns in the group row. It seems I can't show more than 6 columns. Is this a limitation?

Please help as I have been struggling with this for a LOOONG time now...

using VDF 151 and CJ15.1.3 ActiveX COM

thanks
/Leif




Replies:
Posted By: flado
Date Posted: 20 October 2011 at 10:16am
Anyone?
Thanks....


Posted By: Aaron
Date Posted: 04 November 2011 at 9:18am
Hi,
 
I don't see problem....
 
Here's test project, maybe it will help you:   http://forum.codejock.com/uploads/3701/Formulas.zip - uploads/3701/Formulas.zip
 
Good luck Wink
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: flado
Date Posted: 30 November 2011 at 6:49am
Thank you for your answer! I looked at your test project, but it seems that even there the formats of the totals are not correct:



Posted By: Aaron
Date Posted: 06 December 2011 at 9:28am
Hi,
 
I don't see problem... Can you be more specific?
 
Thanks
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Willowmaster
Date Posted: 06 December 2011 at 9:41am
In the BeforeDrawRow event the Grouprows are excluded from formatting. That's why the grouprow is not showing the right formatting.
This is some very bad programming and it has a small bug in it. But i shows it is possible to fix the formatting.
 
Private Sub wndReportControl_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
Dim lngGroupOrder       As Long
Dim lngStartPos         As Long
    If Not Row.groupRow Then
        Metrics.Text = Format(Item.Caption, "### ### ###")
    Else
        lngStartPos = InStr(1, Metrics.Text, "[" & wndReportControl.GroupsOrder.Count & "]")
        If lngStartPos > 0 Then
            Metrics.Text = wndReportControl.GroupsOrder.Column(wndReportControl.GroupsOrder.Count - 1).Caption & ": " & Format(Mid(Metrics.Text, Len(wndReportControl.GroupsOrder.Column(wndReportControl.GroupsOrder.Count - 1).Caption) + 2, lngStartPos - Len(wndReportControl.GroupsOrder.Column(wndReportControl.GroupsOrder.Count - 1).Caption) - 2), "### ### ###") & " [" & wndReportControl.GroupsOrder.Count & "]" & Format(Mid(Metrics.Text, (lngStartPos + Len("[" & wndReportControl.GroupsOrder.Count & "]"))), "### ### ###")
        Else
            Metrics.Text = wndReportControl.GroupsOrder.Column(wndReportControl.GroupsOrder.Count - 1).Caption & ": " & Format(Mid(Metrics.Text, Len(wndReportControl.GroupsOrder.Column(wndReportControl.GroupsOrder.Count - 1).Caption) + 2), "### ### ###")
        End If
    End If
End Sub


-------------
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0





Posted By: Andrew666
Date Posted: 16 February 2012 at 9:00am
I have this same problem --- it appears that SUMSUB uses the Caption of the item, not its Value property - so if I format the Caption in any way, the SUMSUB gives the wrong number.  Surely this is a bug?
 
Also, the SUMSUB behaviour doesn't appear to be as documented.  If I use SUMSUB(C3:C6) for example, this appears to cause the total to be displayed in column 3 of the GroupRow, and sums the column 6 values.
 
Using v15.2.1


Posted By: mihey
Date Posted: 12 May 2014 at 4:06am
Hi everyone,

I've fixed this issue in my case by patching the method StringToDouble of the CXTPReportRecordItem.

double CXTPReportRecordItem::StringToDouble(CString strText)
{

        TCHAR chSep[4];
        GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, chSep, 4);
     strText.Replace(chSep, "");

     TCHAR* locale = _tsetlocale(LC_NUMERIC, NULL);

     if (locale == NULL || _tcscmp(locale, _T("C")) == 0) // Not set
     {
          strText.Replace(',', '.');
     }

     double res = atof(XTP_CT2CA(strText));

     return res;
}

Maybe CJ could take it over into their next release.
Best regards, Mikhail


Posted By: mcmastl
Date Posted: 20 April 2015 at 12:47pm
Thank you for bringing this to our attention, we have informed our development team and we will be looking into the issue.  If the matter has been resolved please let us know.  

-------------
Luke McMasters, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net