This is a migrated thread and some comments may be shown as answers.

A few crosstab questions

5 Answers 527 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Göran Krampe
Top achievements
Rank 1
Göran Krampe asked on 29 Sep 2009, 01:45 PM
Hi!

I am bagning my head against Crosstab here, I am probably missing some important insight. Here are a bunch of questions:

1. Why does the "Row Groups" tray (or what you call it) sometimes show "(RowGroup)" inside parenthesis?
2. Why does a crosstab produced by the wizard seemingly create "double" row groups - one within parentheses and one below that without parentheses?
3. Why do I get "static" "droppings" in my tray layout? They seem to appear when I add/remove rows etc.
4. When I add a row group (child) it seems to add it to the *right or left* of the selected group cell - why not below and above? And how am I supposed to move it afterwards to get it below?

My context: I am creating a report with 3 row groups, stepped layout. Most of this has worked fine - although it seems quite easy to "break" the model so that you get odd error messages and occasionally hanging VS08. Anyway, this is approximately what I want:

Heading1
       Heading2
                 Heading3                              10       20       30
                 Heading3                              10       20       30
       Total                                                 20       40       60

This is quite analogous to the product sales crosstab example. I can't understand what to select and then what menu choice I am supposed to use to create that "Total" above.

regards, Göran

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 30 Sep 2009, 04:19 PM
Hello Göran Krampe,

Thank you for contacting us and up to your questions:
  1. The parenthesis mean that this is a static group i.e. no grouping specified. The groups in the RowGroups hierarchy define rules how the rows of the Table will be repeated, while the groups in the ColumnGroups hierarchy are responsible for the columns. So the leaf groups in the RowGroups (leaf group has no child groups) defines the rows in the Table Body while the leaf column groups define the columns of the Table Body.

    Depending on the grouping criteria, we have:
    • dynamic groups - have any Grouping expression, ex. group1.Grouping.Add(new Grouping("=Fields.Country")). For the dynamic groups, the corresponding row/column will repeat for every record of the grouped data.
    • static groups - no grouping criteria at all. For the static groups the corresponding row/column is rendered only once - i.e. perfect for a footer.
    • detail groups -have a single empty grouping, ex. group1.Grouping.Add(new Grouping()). Usually you have only one row -or- column detail group. For a detail group the corresponding row/column is repeated for every row of the Table's data source. You may think of the detail TableGroup as the Report's Detail section.
  2. Currently the wizard helper items use slightly different template than the regular table/crosstab items. This is not a problem, since you are not limited to a specific template e.g. you might start with a table item and as you progress according to your needs you might end up with a crosstab at the end. Anyway we would make sure the templates are the same for the next version. If you have two row groups - one with parenthesis and one without, this means that you have one static group and one dynamic group (with grouping criteria).
  3. It all depends on what you add and what is your starting point of adding. If you have clicked on a static row group then you would be prompted for row above/below only, while if you click on a dynamic group you would have the option to select whether that would be outside or inside group that you're adding as well.
  4. This depends on the group hierarchy structure. The group hierarchies (or trees) should be always balanced - that is all branches should have the same depth. This means that you should connect more empty groups (in depth) whenever needed in order to achieve specific layout. These groups are required just to align/balance the group tree. If you imagine the group hierarchy as tree, you would be able to understand why is group added below/above or left/right.
The table item does not have a concept for footer or for that matter row/column and header as well. In this line of thoughts there is nothing "specific" for a footer - it is just a static row group as can be seen from the crosstab demo report you've seen. Also not sure if you have noticed that there is a video showing how the demo crosstab report is built. Please review it and let us know if further help is needed.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Göran Krampe
Top achievements
Rank 1
answered on 01 Oct 2009, 09:24 AM
Hi!

Regarding #1 and #2: You said "The parenthesis mean that this is a static group i.e. no grouping specified. ". Ok, so obviously when I create a stepped layout the wizard creates intermediate static groups for me... Although I am still uncertain why.

Regarding #3: With "droppings" I mean static row groups that are "left overs". If I add a row and then delete it etc, that is when they seem to be created. I don't have an example in front of me, but messing around in a stepped layout should easily create them if you test that.

Regarding #4: I am not sure how that translates into my specific problem. Please try the following - create a simple two rowgroup level stepped layout. Then try to add a "total group footer" for the second (or first) rowgroup (by doing "Add row outside group below"). You will notice that since the stepped layout has created something looking similar to this:

(Heading1)
    Heading1
    (Heading2)
        Heading2
...

...when you add this row  it will end up being associated with "(Heading2)" which is the group *outside* of "Heading2" and not the intended group *one step higher* - "Heading1". All in all, the stepped layout (or whatever) seemingly have caused the Designer tools (all the menu choices available etc) to not let me do this. I ended up having to hand edit the generated code changing order of the "Rowgroups.Childs.Add(yadda)" lines to get what I wanted!

Regarding the video: I watched it and unfortunately it turns out highly uninteresting since it ONLY uses the wizard and does not actually *edit* the resulting crosstab. I would like to see a video producing a *stepped* layout with "total footers" for each group. :) To me it seems more or less impossible to achieve (throwing a glove here :) ).

Conclusion:

I have unfortunately spent several days trying to produce a report with a stepped layout including totals on the rowgroups. I have bumped into lots of "bugs" in the designer, for example undo not working properly, "static" droppings that I can't remove, rows/cells that I suddenly can not select because it says "Object reference not set to an instance of object" or "Cannot select a cell with no report item" etc etc. And occasionally "hanging" the designer. I conclude that while the crosstab *model* may be fine the designer is unfortunately alpha quality. And using the stepped layout (the only one I have tried since it is what we want) I seemingly end up in situations that are totally unexplicable or I just can't figure out how to do things.

Today I will try to create a "layer" on top of Crosstab (using the generated code as inspireation) in which we can work and create our reports fully programmatically and skip the designer. It is a bit unfortunate because we really wanted to stay away from "visual fiddling" in code, but as it seems this is the route we will have to go.

regards, Göran

PS. Attached a small picture showing a funny crosstab. There is no way to delete that empty column or row AFAICT, I can't even select any of them.
0
Svetoslav
Telerik team
answered on 05 Oct 2009, 03:03 PM
Hello Göran Krampe,

The Table/Crosstab items were introduced in the 2009 Q1 release and we still have a lot of work to be done in order to make it really easy to use and most importantly -  understandable for users.  We are aware of the poor behavior of the Table item designer and we are currently working on it so the Q3 release will bring you a new and improved group explorer and much better undo/redo support. Until then we would suggest to restrain from undoing any operations over the Table item since they may brake the item completely (as the screenshot shows).

As you've already seen the Table item is very complex, yet quite powerful item and even we sometimes have a hard time explaining its special features.

As you may have noticed the Table item uses a slightly different approach than the usual Grid components. Looking into the internals of the item you won't find any explicit rows and columns defined, although when rendered the data is displayed in a grid format. Instead the entire definition is based on two hierarchies of groups that maintain the rows and columns of the Table: the RowGroups hierarchy defines the rows of this underlying grid while the ColumnGroups defines the columns. In addition TableGroups may or may not be attached to a specific data and TableGroups may or may not have header items associated with them. The data (defined through the grouping criteria, group's filter and sorting) defines the way the TableGroup will appear.

For example a TableGroup from the RowGroups hierarchy that is configured to group by the County field will create a new row for each different country that appears in the Table's data source; accordingly a TableGroup that groups by the Year field and is in the ColumnGroups hierarchy will create a new column for each different year. This is how the dynamic groups behave.

If TableGroup has no grouping defined it will appear only once thus creating a single row or column. We used to call these groups static and they appear in the Group Explorer in gray. The only purpose of such groups is to add single rows/columns to the grid layout.

TableGroups may have header items associated with them. These items (when available) appear as a row or column header accordingly to the hierarchies where the groups reside. Groups that have no header item still take part in the grid processing and generation except that they would have no visual appearance. Such "invisible" groups are displayed in the Group Explorer in brackets ().

As you have pointed some operations may leave such static invisible groups. Such groups have no effect neither on the data nor the underlying grid so we're not considering them "bad" in no way.

Regarding your initial question #4. As you may have noticed there are two subsets of operations that are available for the Table though the context menu of the cells:
  • layout operations that modify the grid layout only - add/delete row/column. According to the current selection this operation adds row or column groups;
  • group operations that modify the logical organization of the Table - add/delete group. According to the current selection this may add a parent/child/sibling group.
So in short if you need to add a row you just use the Insert row command and not mess with the groups.

Please have in mind that all operations work against the effective dynamic groups since the dynamic groups form the logical structure of the Table item.

Sincerely yours,
Svetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
michael
Top achievements
Rank 1
answered on 04 May 2010, 11:50 AM
Hi

I have created Cross Tab Report.
I have tried to attach the report here but it gives invalid filetype error.
I have 2 level hierachy, everything goes well but whenever i tried to insert this last row as shown in the screen shot, textbox is not getting placed near total column textbox and then when ever it tried to select row or column in report , it gives me below error.
---------------------------
Microsoft Visual Studio
---------------------------
Cannot select a cell with no report item.
---------------------------
OK   
---------------------------
  
I have not done anything complex, but i dont know where i got stuck. can you please help me to fix this.
Thx
Hetal
0
Milen | Product Manager @DX
Telerik team
answered on 07 May 2010, 10:13 AM
Hello michael,

What version of our product are you using? From you account records it seems like you are using an older version. Please try the latest 2010 Q1 SP1 version. If the problem persists, please open a support ticket where you can attach a zip containing a sample report and describe the exact action needed to reproduce the wrong behavior.

Suggestion: When you try to insert a row/column you need to step and right click on a cell that is not merged (it may be in the table/crosstab body, that is OK).

Hope this information helps.

Greetings,
Milen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Göran Krampe
Top achievements
Rank 1
Answers by
Steve
Telerik team
Göran Krampe
Top achievements
Rank 1
Svetoslav
Telerik team
michael
Top achievements
Rank 1
Milen | Product Manager @DX
Telerik team
Share this question
or