Mystified by Cross-Tab Reports

edited March 2004 in FastReport 2.xx VCL
I would ideally like to use the AdvCrossTab object. But, for the report I'm producing, I cannot have a row-based total. So I'm using the "simple cross-tab" components.

I want to produce a report like this:

Date1 Date2 Date3
CODE DESCRIPTION UoM
X X desc Each Count Count Count
Y Y desc Each Count Count Count


I have a single dataset consisting of the fields:
* ID
* CODE
* DESCRIPTION
* UOM
* COUNT_DATE
* STOCK_COUNT
* VALUATION

In FR, I have laid out the Master Header, Master Data, Crosstab Header, CrossTab Data objects.

The output I get is a single row with each data value having its own unique column!

How do I make the values map into the COUNT_DATE-based columns?
How do I make the values map into the CODE-based rows?

I have looked at the example "Simple CrossTab" demo, and I do not understand the syntax or significance of these:
* Row ??[Master position]
* Header [Col position]
Are Row and Header functions?
What is the significance (if any) of the "??"?
Where does this "position" variable come from?
Are "Master" and "Col" referring to fields? or to Bands? or what?

Your assistance will be appreciated!

Comments

  • edited 1:16AM
    Here is the report I'm wanting to get:

    Row header (contains three fields), where the cross-tab is grouped by CODE:
    * CODE
    * DESCRIPTION
    * UoM

    Column headers, grouped by COUNT_DATE.

    Cross:
    * [Sum([STOCK_COUNT])]
    * [Sum([VALUATION])]
  • gordkgordk St.Catherines On. Canada.
    edited 1:16AM
    hi loryn
    [MasterPosition] is variable defind in data dictionary
    Row ?? is just text formed using altkey and typing 0185
    regards ;)
  • edited 1:16AM
    Thank you, Gordk. I understand what those variables mean now.

    However, my report still does this:

    ROW1 VALUE1 VALUE2 VALUE3 VALUE4 VALUE5 .... VALUEn

    but what I want is this:

    ROW1 VALUE1 VALUE2 VALUE3
    ROW2 VALUE4 VALUE5 VALUE6
    ...

    How does FR control which line / column the values go into? Do I have the sort the data in any particular order?
  • gordkgordk St.Catherines On. Canada.
    edited 1:16AM
    Hi loryn
    looking at the simple crosstab demo.
    since it is using virtual datasets it is some what hard to see how it would line up with a table or query.
    masterband corresponds to records in the table,
    crossdataband corresponds to the fieldcount of the table.

    try this it may help you understand it better
    lets cut back to display 5 columns across
    select the crosstab databand in obinspect select data source in the datasource editor all 3 band connections set to virtual 5 records
    now for the value in cell
    you must change the expression in the dictionary to
    ([Line#]-1)*5+[Column#] to get the right values.
    you may have to write onuserfunction events to handle passing out the column number and retreiving the value of that field number or name for headermemo
    or for the cell memo value.
    if any grouping is involved the table or query would have to be sorted on that basis
    regards ;)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.