Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Reporting

Explorer ,
Apr 23, 2008 Apr 23, 2008
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)
432
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 23, 2008 Apr 23, 2008
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 24, 2008 Apr 24, 2008
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 24, 2008 Apr 24, 2008
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 24, 2008 Apr 24, 2008
LATEST
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.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources