Quantcast
Channel: Adobe Community : Popular Discussions - Reporting
Viewing all articles
Browse latest Browse all 38309

Problems with dynamic grouping

$
0
0
I'm in the process of converting a fair number of crystal report to coldfusion reports and I'm having a heck of time with dynamic grouping in coldfusion reports. The original crystal report changes the grouping based on parameter values. I tried doing this in coldfusion reports but I found that if the select statement wasn't ordered on the desired field, the groups were not contiguous.

So, I used an advanced query to build my statement but that made a group header for each record, even for identical values! I went ahead and created a brand new report from scratch using the advanced query and it works fine...until I change the query. I went and modified the value of one of my dynamic columns (same datatype) and the report started generating group headers for identical records again. I've purposefully made mistakes in the query to see if that was the problem but the query executes fine and returns the expected results. For whatever reason, coldfusion reports thinks the data has changed and is issuing group headers when it shouldn't. I've deleted the column and added it back in. I've removed the group and tried to recreate it but that does not resolve the issue.

I'm using Oracle 9i, CF server 7.02, IIS 6 and windows 2003.

Here's what I would expect to see:

group1.value1
group2.value1
detail1
detail2
group2.value2
detail1
.
.
.

Instead, this is the output I am seeing:

group1.value1
group2.value1
detail1
group2.value1 <--- why is this extra group printing?
detail2
group2.value2
detail1

Any help with this would be greatly appreciated as I'm wasting a lot of time trying to figure this out. Oh, I should probably post my query, here it is:

<cfquery name="CFReportDataQuery" datasource="test_dsn">
SELECT
decode('#lcase(param.pTSGroup1By)#', 'company', company, '') as group1,
decode('#lcase(param.pTSGroup1By)#', 'submit date', trunc(submit_date, 'mm'), '1-Jan-1900') as group2,
decode('#lcase(param.pTSGroup2By)#', 'type', type, '') as group3,
decode('#lcase(param.pTSGroup2By)#', 'week', submit_date, '1-Jan-1900') as group4,
TICKET_ID, SUBMIT_DATE, SUBMIT_BY, OWNER, STATUS, TYPE, SUBTYPE, TIME_SPENT, COMPANY, BILLABLE_RATE, BILLABLE_UNIT
FROM ENG_RPT_TICKETS_V
order by group1, group2, group3, group4
</cfquery>



Viewing all articles
Browse latest Browse all 38309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>