0
Reporting
Explorer
,
/t5/coldfusion-discussions/reporting/td-p/65213
Apr 23, 2008
Apr 23, 2008
Copy link to clipboard
Copied
I have various tables in my database and I am creating a
report that should show an electoral constituency along with the
votes that each party has received in that constituency. But I ca
figure out how to create a report that shows the constituency and
then all votes received for each party, one row at a time. My query
right now shows the constituency name, the party name and the votes
received.
I tried to use CFReportBuilder but could not figure it out. Please help. Thanks
My tables are as follows:
VoteResults(Party, ResultCategory, Votes, AgentPhone)
Cnstituency( ConstituencyNo, ConstituencyName,RegionCode, District)
PollingStation(StationNo, COnstituencyNo, StationName, AgentPhoneNo)
I tried to use CFReportBuilder but could not figure it out. Please help. Thanks
My tables are as follows:
VoteResults(Party, ResultCategory, Votes, AgentPhone)
Cnstituency( ConstituencyNo, ConstituencyName,RegionCode, District)
PollingStation(StationNo, COnstituencyNo, StationName, AgentPhoneNo)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/reporting/m-p/65214#M6698
Apr 23, 2008
Apr 23, 2008
Copy link to clipboard
Copied
So first of all, do you need help with the query or the
output or both?
I.E. are you getting the results you need from your query?
If you don't know, <cfdump var="#qryName#"> is great for quickly seeing
what was returned.
I.E. are you getting the results you need from your query?
If you don't know, <cfdump var="#qryName#"> is great for quickly seeing
what was returned.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Abdlah
AUTHOR
Explorer
,
/t5/coldfusion-discussions/reporting/m-p/65215#M6699
Apr 24, 2008
Apr 24, 2008
Copy link to clipboard
Copied
Sorry my question was not clear. The query works fine, I am
just trying to find out how I can display my output so that for
each constituency I show the constituency name in a column followed
by results for all the parties in that constituency in my
VoteResults table.
Currently I can only show the results by repeating the the constituency with each party's vote count.
So instead of having to report the results as:
London: Labor 40, London: Conservatives 33, London: Reform Party 20, and London: Liberal Democrats 15
I Want to report it as:
London: Labor 40, Conservatives 33, Reform Party 20, Liberal Democrats 15
I hope I have made it clearer.
Currently I can only show the results by repeating the the constituency with each party's vote count.
So instead of having to report the results as:
London: Labor 40, London: Conservatives 33, London: Reform Party 20, and London: Liberal Democrats 15
I Want to report it as:
London: Labor 40, Conservatives 33, Reform Party 20, Liberal Democrats 15
I hope I have made it clearer.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Abdlah
AUTHOR
Explorer
,
/t5/coldfusion-discussions/reporting/m-p/65216#M6700
Apr 24, 2008
Apr 24, 2008
Copy link to clipboard
Copied
Sorry my question was not clear. The query works fine, I am
just trying to find out how I can display my output so that for
each constituency I show the constituency name in a column followed
by results for all the parties in that constituency in my
VoteResults table.
Currently I can only show the results by repeating the the constituency with each party's vote count.
So instead of having to report the results as:
London: Labor 40, London: Conservatives 33, London: Reform Party 20, and London: Liberal Democrats 15
I Want to report it as:
London: Labor 40, Conservatives 33, Reform Party 20, Liberal Democrats 15
I hope I have made it clearer.
Currently I can only show the results by repeating the the constituency with each party's vote count.
So instead of having to report the results as:
London: Labor 40, London: Conservatives 33, London: Reform Party 20, and London: Liberal Democrats 15
I Want to report it as:
London: Labor 40, Conservatives 33, Reform Party 20, Liberal Democrats 15
I hope I have made it clearer.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/coldfusion-discussions/reporting/m-p/65217#M6701
Apr 24, 2008
Apr 24, 2008
Copy link to clipboard
Copied
Abdlah wrote:
> Sorry my question was not clear. The query works fine, I am just trying to find
> out how I can display my output so that for each constituency I show the
> constituency name in a column followed by results for all the parties in that
> constituency in my VoteResults table.
>
> Currently I can only show the results by repeating the the constituency with
> each party's vote count.
>
> So instead of having to report the results as:
>
> London: Labor 40, London: Conservatives 33, London: Reform Party 20, and
> London: Liberal Democrats 15
>
> I Want to report it as:
> London: Labor 40, Conservatives 33, Reform Party 20, Liberal Democrats 15
>
> I hope I have made it clearer.
>
Then you just need to look up the <cfoutput...> tag and pay attention to
the "group" parameter. Basically it will look something like this.
<cfoutput query="myQuery" group="aField">
#myQuery.aField#
<!--- Displayed once per value of aField --->
<cfoutput>
#myQuery.bField# #myQuery.cField#
<!--- Displayed once per record --->
</cfoutput>
<br/>
<!--- Displayed once per value of aField --->
</cfoutput>
This works on the idea that the data in the record set is ordered by aField.
> Sorry my question was not clear. The query works fine, I am just trying to find
> out how I can display my output so that for each constituency I show the
> constituency name in a column followed by results for all the parties in that
> constituency in my VoteResults table.
>
> Currently I can only show the results by repeating the the constituency with
> each party's vote count.
>
> So instead of having to report the results as:
>
> London: Labor 40, London: Conservatives 33, London: Reform Party 20, and
> London: Liberal Democrats 15
>
> I Want to report it as:
> London: Labor 40, Conservatives 33, Reform Party 20, Liberal Democrats 15
>
> I hope I have made it clearer.
>
Then you just need to look up the <cfoutput...> tag and pay attention to
the "group" parameter. Basically it will look something like this.
<cfoutput query="myQuery" group="aField">
#myQuery.aField#
<!--- Displayed once per value of aField --->
<cfoutput>
#myQuery.bField# #myQuery.cField#
<!--- Displayed once per record --->
</cfoutput>
<br/>
<!--- Displayed once per value of aField --->
</cfoutput>
This works on the idea that the data in the record set is ordered by aField.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

