Moving Columns |
Post Reply |
Author | |
skiman
Groupie Joined: 20 December 2008 Location: Belgium Status: Offline Points: 88 |
Post Options
Thanks(0)
Posted: 26 August 2015 at 9:30am |
Hi,
I have a report control with the same columns as in the following sample screenshot. If I move the column Sales and put it between 'Product' and 'State' the grouptotal remains in the same column, which is state at that moment. How can I be sure that my subtotals remains in the same column as originally at startup? |
|
ABO Service
|
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello Chris,
Subtotals are linked to appropriate columns. If you have access to C++ project then you can change this behaviour in CXTPReportPaintManager::DrawGroupRow method (toolkitpro\Source\ReportControl\XTPReportPaintManager.cpp). Index of appropriate column is in iCol variable. Regards, Oleksandr Lebed |
|
skiman
Groupie Joined: 20 December 2008 Location: Belgium Status: Offline Points: 88 |
Post Options
Thanks(0)
|
Hi,
I'm using the active-x version. I tried to change the groupformula of the grouprow dynamically when a column is moved. Sample: formula SUMSUB(C5:C6) is changed to SUMSUB(C3:C4) when the column is moved. The subtotals are moving, but strangely they remains now zero. I have no clue what the cause of this behaviour could be. |
|
ABO Service
|
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
When you move columns their indexes are not changed, just their order. So C5 - always points to the column with index 5.
|
|
skiman
Groupie Joined: 20 December 2008 Location: Belgium Status: Offline Points: 88 |
Post Options
Thanks(0)
|
You wrote:
When you move columns their indexes are not changed, just their order. So C5 - always points to the column with index 5.
I'm using the active-x evaluation version 16.4.0, and the index IS CHANGING when moving columns. I tested as follows: When creating the columns: oColumn := oReport:Columns:add(0, "Category", 12, .t.) oColumn:key := str(oColumn:index,2) ... So I put the index for each column in the KEY property. When the report is created, I do the following: nCols := oReport:Columns:Count -1 for x = 0 to nCols show oReport:columns(x):index show oReport:columns(x):key next For each column, the index is equal to the key. When I move a column, and checks it again, the INDEX is changed. The index isn't corresponding anymore to the KEY which obviously isn't changed. This behaviour poses a lot of problems when columns with subtotals are moved. This is why I need to change the formula. I'm using the value in the KEY property to define which column must have subtotals. Since the data shown is still correct, there must be a property that knows which item of the record must be shown. After moving a column for 4 to column 2, the index is changed. However it is still oRecord:item(4) which is shown. |
|
ABO Service
|
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Sorry, I meant ItemIndex Property of ReportColumn Object.
From documentation
|
|
skiman
Groupie Joined: 20 December 2008 Location: Belgium Status: Offline Points: 88 |
Post Options
Thanks(0)
|
Hi,
Thanks, I missed this ItemIndex property. So no need anymore to keep the original index in the KEY property. |
|
ABO Service
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |