If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Repeater Table

Started by pammassey, 22 Jun 2017 11:44:14 AM

Previous topic - Next topic

pammassey

I have a list report grouped and sectioned on country (there are only 2 countries) that is in a repeater table. The repeater table is set up with Across = 2 and Down = 1 in the hopes that it will create 2 list reports aligned horizontally rather than vertically. However, it is still displaying the lists vertically. Any ideas on how to fix this?

New_Guy

Hi,
The way you did the set up is right and It should display horizontally. Are you sure you are having only 2 countries?
Good luck
New guy

pammassey

Yes there are only 2 countries.

New_Guy

#3
Hi,
Below is the xml of a report and attached is the output. Are you doing exactly the same. If you still face any issues, don't worry we will figure it out tomorrow. Check the master detail between repeater and the list.
Good luck
New guy


<report xmlns="http://developer.cognos.com/schemas/report/12.0/" useStyleVersion="10" expressionLocale="en-us">
<modelPath>/content/folder[@name='Samples']/folder[@name='Cognos Samples']/folder

[@name='Models']/package[@name='GO Sales (query)']/model[@name='model']</modelPath>
<drillBehavior modelBasedDrillThru="true"/>
<layouts>
<layout>
<reportPages>
<page name="Page1">
<style>
<defaultStyles>
<defaultStyle refStyle="pg"/>
</defaultStyles>
</style>
<pageBody>
<style>
<defaultStyles>
<defaultStyle refStyle="pb"/>
</defaultStyles>
</style>
<contents><repeaterTable across="2" name="Repeater Table1"

refQuery="Repeater Query" down="1">
<repeaterTableCell>
<contents><textItem><dataSource><dataItemValue refDataItem="Product line"/></dataSource></textItem><list

horizontalPagination="true" name="List1" refQuery="List Query">



<noDataHandler>
<contents>
<block>
<contents>
<textItem>
<dataSource>
<staticValue>No Data Available</staticValue>
</dataSource>
<style>
<CSS value="padding:10px 18px;"/>
</style>
</textItem>
</contents>
</block>
</contents>
</noDataHandler>
<style>
<CSS value="border-collapse:collapse"/>
<defaultStyles>
<defaultStyle refStyle="ls"/>
</defaultStyles>
</style>
<listColumns><listColumn><listColumnTitle><style><defaultStyles><defaultStyle

refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Product

line"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle

refStyle="lc"/></defaultStyles><CSS value="white-space:nowrap"/></style><contents><textItem><dataSource><dataItemValue refDataItem="Product

line"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle

refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Product line

code"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle

refStyle="lc"/></defaultStyles><CSS value="white-space:nowrap"/></style><contents><textItem><dataSource><dataItemValue refDataItem="Product line

code"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle

refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Product type

code"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle

refStyle="lc"/></defaultStyles><CSS value="white-space:nowrap"/></style><contents><textItem><dataSource><dataItemValue refDataItem="Product type

code"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle

refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Product

type"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle

refStyle="lc"/></defaultStyles><CSS value="white-space:nowrap"/></style><contents><textItem><dataSource><dataItemValue refDataItem="Product

type"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle

refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Product

number"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle

refStyle="lc"/></defaultStyles><CSS value="white-space:nowrap"/></style><contents><textItem><dataSource><dataItemValue refDataItem="Product

number"/></dataSource></textItem></contents></listColumnBody></listColumn></listColumns><masterDetailLinks><masterDetailLink><masterContext><dataI

temContext refDataItem="Product line"/></masterContext><detailContext><dataItemContext refDataItem="Product

line"/></detailContext></masterDetailLink></masterDetailLinks></list></contents>
<style>
<CSS value="padding:3mm;vertical-align:top"/>
<defaultStyles>
<defaultStyle refStyle="rc"/>
</defaultStyles>
</style>
</repeaterTableCell>
<style>
<CSS value="border-collapse:collapse"/>
<defaultStyles>
<defaultStyle refStyle="rt"/>
</defaultStyles>
</style>
</repeaterTable></contents>
</pageBody>
</page>
</reportPages>
</layout>
</layouts>
<XMLAttributes><XMLAttribute name="RS_CreateExtendedDataItems" value="true" output="no"/><XMLAttribute

name="listSeparator" value="," output="no"/><XMLAttribute name="RS_modelModificationTime" value="2012-05-25T17:27:04.963Z"

output="no"/></XMLAttributes><queries><query name="Repeater Query">
<source>
<model/>
</source>
<selection><dataItem name="Product line" aggregate="none" rollupAggregate="none"><expression>[Product forecast (query)].

[Products].[Product line]</expression><XMLAttributes><XMLAttribute name="RS_dataType" value="3" output="no"/><XMLAttribute name="RS_dataUsage"

value="attribute" output="no"/></XMLAttributes></dataItem></selection>
<detailFilters><detailFilter><filterExpression>[Product line] in ('Mountaineering Equipment', 'Camping Equipment')

</filterExpression></detailFilter></detailFilters></query><query name="List Query">
<source>
<model/>
</source>
<selection><dataItem name="Product line code" aggregate="none" rollupAggregate="none"><expression>[Product forecast

(query)].[Products].[Product line code]</expression><XMLAttributes><XMLAttribute name="RS_dataType" value="1" output="no"/><XMLAttribute

name="RS_dataUsage" value="identifier" output="no"/></XMLAttributes></dataItem><dataItem name="Product line" aggregate="none"

rollupAggregate="none"><expression>[Product forecast (query)].[Products].[Product line]</expression><XMLAttributes><XMLAttribute

name="RS_dataType" value="3" output="no"/><XMLAttribute name="RS_dataUsage" value="attribute" output="no"/></XMLAttributes></dataItem><dataItem

name="Product type code" aggregate="none" rollupAggregate="none"><expression>[Product forecast (query)].[Products].[Product type code]

</expression><XMLAttributes><XMLAttribute name="RS_dataType" value="1" output="no"/><XMLAttribute name="RS_dataUsage" value="identifier"

output="no"/></XMLAttributes></dataItem><dataItem name="Product type" aggregate="none" rollupAggregate="none"><expression>[Product forecast

(query)].[Products].[Product type]</expression><XMLAttributes><XMLAttribute name="RS_dataType" value="3" output="no"/><XMLAttribute

name="RS_dataUsage" value="attribute" output="no"/></XMLAttributes></dataItem><dataItem name="Product number" aggregate="none"

rollupAggregate="none"><expression>[Product forecast (query)].[Products].[Product number]</expression><XMLAttributes><XMLAttribute

name="RS_dataType" value="1" output="no"/><XMLAttribute name="RS_dataUsage" value="identifier"

output="no"/></XMLAttributes></dataItem></selection>
</query></queries></report>




pammassey

Tough for me to know for sure.

New_Guy

Hi,

1. Unlock the repeater and place the List inside and use the same query that you are using for the repeater table.
2. Click the 3 orange dots on the top left of the list.
3. Check the properties pane located on the bottom left corner of reportstudio.
4. Double click on the master detail and you will see a window with a query on each side.
5. Click on the new link and connect the countries from both the side.
6. Drag the required items to the list and you should be good to go.

Good luck
New guy

sjdig

I'm going to piggyback on this topic as I have a related question regarding repeaters or repeater tables.

Is it possible to have an item be the driving piece of a list where the sub-item repeats horizontally across rows.

For some exposition, I'm working on a report that I need to be driven by an item that can have up to four additional items attached. However, I need to also account for null values in the instance of there being less than four items.

Primary # | Attached # | Attached # | Attached # | Attached # |
12345      | 456789      | 987654      |  345678     |  876543 |
45678      | 159951      | 357753      |  852258     |              |
90123      | 147741      | 741147      |                  |              |
10123      | 868686      |                  |                  |              |

Is this possible to do using a repeater table in some manner? I need the output to go to a CSV for use in another system. So, it does have to be in this type of formatting with a driving value and repeating any possible attached values but still accounting for nulls with empty fields.

Thanks in advance for any advice or guidance you can give,
sjdig

Lynn

Quote from: sjdig on 23 Jun 2017 08:59:03 AM
I'm going to piggyback on this topic as I have a related question regarding repeaters or repeater tables.

Is it possible to have an item be the driving piece of a list where the sub-item repeats horizontally across rows.

For some exposition, I'm working on a report that I need to be driven by an item that can have up to four additional items attached. However, I need to also account for null values in the instance of there being less than four items.

Primary # | Attached # | Attached # | Attached # | Attached # |
12345      | 456789      | 987654      |  345678     |  876543 |
45678      | 159951      | 357753      |  852258     |              |
90123      | 147741      | 741147      |                  |              |
10123      | 868686      |                  |                  |              |

Is this possible to do using a repeater table in some manner? I need the output to go to a CSV for use in another system. So, it does have to be in this type of formatting with a driving value and repeating any possible attached values but still accounting for nulls with empty fields.

Thanks in advance for any advice or guidance you can give,
sjdig

Not sure about all of what you are describing, but CSV output is only going to give you raw unformatted data from the query.

sjdig

Sorry if I was unclear.

Basically, I would need the CSV to do the following.

Primary # | Attached # | Attached # | Attached # | Attached # |
12345      | 456789      | 987654      |  345678     |  876543 |
45678      | 159951      | 357753      |  852258     |   null      |
90123      | 147741      | 741147      |  null           |   null      |
10123      | 868686      | null            |  null           |   null      |

In the scenarios above, the first is driving by the primary # of 12345, which then has four secondary numbers attached. Second has driving # of 456789, when only has three secondary numbers attached, and so forth.

Attached # is one data item in the query itself, but can repeat up to a maximum of those four times.

I would need the output to produce empty rows on scenarios two through four as the system I'll be using the CSV in must account for max possible numbers of secondary numbers.

So, I would need null values to be stored as empty spaces in the CSV with a separator.

I'm just unsure as to how to accomplish this using a repeater table or if it's even possible. I have it working okay when it produces as an HTML report, but attempting to use it in any other format, it's been dropping the repeater table entirely and just giving back the driving primary number.

sjdig

New_Guy

Hi,
You can try placing a repeater table as a second column after the primary and set it up as 4 across and 1 down. How big is this report as this type of reports can create performance issues? you can use cross tab as a list column and place the attachment as cross tab column.Run the report in excel and then you have to save it in CSV format. Like Lynn said running directly in CSV will not show the attachment if it is in a repeater or a cross tab.
Good luck
New guy

sjdig

Thank you for the feedback. I'll give it a try. I was hoping to have it set as an automatic process daily that the other system will pick up without manual intervention.

I've been testing using count and rank and using those to create filters instead and do a union at the end to get the data needed so that the CSV can be scheduled and require no intervention.

Example:

Data item to count # of secondary accounts for primary accounts: count ([Secondary #] for [Primary #])
Data item to rank secondary accounts for primary accounts: rank([Secondary #] for [Primary #])

I had to create three placeholder data items in each query for potential null instances at the end when I created a Union.

Then, four queries with the following filters.

Query One:

count ([Secondary #] for [Primary #]) = 4 and rank([Secondary #] for [Primary #]) = 1
count ([Secondary #] for [Primary #]) = 3 and rank([Secondary #] for [Primary #]) = 1
count ([Secondary #] for [Primary #]) = 2 and rank([Secondary #] for [Primary #]) = 1
count ([Secondary #] for [Primary #]) = 1 and rank([Secondary #] for [Primary #]) = 1

All will always have at least one.

Query Two:

count ([Secondary #] for [Primary #]) = 4 and rank([Secondary #] for [Primary #]) = 2
count ([Secondary #] for [Primary #]) = 3 and rank([Secondary #] for [Primary #]) = 2
count ([Secondary #] for [Primary #]) = 2 and rank([Secondary #] for [Primary #]) = 2


Only first three instances will have a value in the second place.

Query Three:

count ([Secondary #] for [Primary #]) = 4 and rank([Secondary #] for [Primary #]) = 3
count ([Secondary #] for [Primary #]) = 3 and rank([Secondary #] for [Primary #]) = 3


Only last two instances will have a value in the third place.

Query Four:

count ([Secondary #] for [Primary #]) = 4 and rank([Secondary #] for [Primary #]) = 4

Only final scenario will have a value in the fourth place.

Then at the end in my union.

maximum([Union].[Secondary #])
maximum([Union].[Secondary #1])
maximum([Union].[Secondary #2])
maximum([Union].[Secondary #3])

Using the maximum made the data fill with a number if it existed, otherwise the maximum was a null anyway. This prevented the need for the repeater table at the page level at the end.

I know it's a bit of a workaround and I'm not quite at the point where I have everything I need, but I wanted to share another potential way of solving my problem should it arise again for someone else.

sjdig