Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsDisplay "useful report" "Member Roster" by role?Display "useful report" "Member Roster" by role?
Previous
 
Next
New Post
8/24/2011 5:58 PM
 
I have a DNN 5.6.3 site on which I'm trying to replace a complicated Excel macro (whose author has left us!) with a Reports query.  Our site, www.oaklandsymphonychorus.org, is used by a community chorus, and I want to create 4 reports, one for each voice part (soprano, alto, tenor, and bass), displaying the address and contact information for each person, sorted by last name first name.  Each voice part is a security role in the DNN site; in addition, we have a security role called "Active Member" which allows me to move people into and out of this year's chorus, as singers may sing, drop for a while and come back.  I can run the "Member Roster" query, listed in the "Useful reports" sticky post, against my database, and it displays EXACTLY what I want.  (Yay!)  But I can't figure out how to modify the query to make it select all the users in the "Active Member" role, and from that subset, select all the users in the "Soprano" role (and so on for the other 3 voices. :(  I've tried several options but all I get are SQL syntax errors.

I'm just barely literate in SQL - I can understand the report enough to modify the order of displayed fields and add a new field to the display.  But I can't figure out how to state the selects on the roles.  Can someone help me?

hedera
**********
Nature bats last.
 
New Post
8/29/2011 9:37 PM
 
I've successfully modified the Member Roster useful report to filter on a single value in the field dbo.UserRoles.RoleID.  Any given user in our database has at least 2 and possibly as many as 5 RoleID values.  The following query works for a single value of this field:
SELECT TOP (100) PERCENT dbo.Users.LastName AS [Last Name], 
                         dbo.Users.FirstName AS [First Name],
                         Address.PropertyValue AS Address,
                         City.PropertyValue AS City,
                         State.PropertyValue AS State,
                         Zip.PropertyValue AS Zip,
                         Phone.PropertyValue AS [Phone Num], 
                         dbo.Users.Email
FROM                     dbo.Users 
INNER JOIN        dbo.UserRoles 
ON        dbo.Users.UserID = dbo.UserRoles.UserID
AND dbo.UserRoles.RoleID = 5 
INNER JOIN               dbo.UserProfile AS Address 
ON                       dbo.Users.UserID = Address.UserID 
AND                      Address.PropertyDefinitionID = '26' 
LEFT OUTER JOIN          dbo.UserProfile AS City 
ON                       dbo.Users.UserID = City.UserID 
AND                      City.PropertyDefinitionID = '27'
LEFT OUTER JOIN          dbo.UserProfile AS State 
ON                       dbo.Users.UserID = State.UserID
AND                      State.PropertyDefinitionID = '28'
LEFT OUTER JOIN          dbo.UserProfile AS Zip 
ON                       dbo.Users.UserID = Zip.UserID 
AND                      Zip.PropertyDefinitionID = '30'
LEFT OUTER JOIN          dbo.UserProfile AS Phone 
ON                       dbo.Users.UserID = Phone.UserID
AND                      Phone.PropertyDefinitionID = '31'

The statement above displays the fields for all members of the "Active Member" role (value 5). If I change the value to read

AND dbo.UserRoles.RoleID = 7

(or 8, or 9, or 10) it will display all members of those roles (we are a chorus, and those roles represent voice parts: alto, soprano, tenor, and bass). I want to select on both the "Active Member" role and a single voice part role, so as to display a separate roster for each voice part. When I created this statement I didn't get a SQL error, but the display only showed the column headers. I know by experiment that I can select all the members of any single role. Why does an attempt to select all members of two roles fail to find any data?


hedera
**********
Nature bats last.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsDisplay "useful report" "Member Roster" by role?Display "useful report" "Member Roster" by role?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out