Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AspDotNetStoreFront
  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

FCKeditor Project
Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Reports Module ...  Simple Report?
Previous Previous
 
Next Next
New Post 8/27/2008 7:58 AM
User is offline jgurley
62 posts
10th Ranked


Simple Report? 

Can someone head me in the right direction to add column(s) in the following report that display the Security Roles for each record?

 

select UserID, DisplayName, Email from dbo.Users order by UserID asc

 
New Post 8/29/2008 4:05 AM
User is offline Lars Tungen
13 posts
10th Ranked


Re: Simple Report? 

This will add a roles column with all roles for each user:

SELECT 
	UserID, 
	DisplayName, 
	Email,
	(
		SELECT 
			RoleName + ', '
		FROM
			{databaseOwner}{objectQualifier}Roles R
			INNER JOIN {databaseOwner}{objectQualifier}UserRoles UR ON (UR.RoleID=R.RoleID AND UR.UserID=U.UserID)
		WHERE 
			(UR.EffectiveDate IS NULL OR UR.EffectiveDate <= getdate()) AND (UR.ExpiryDate IS NULL OR getdate() < UR.ExpiryDate)
		FOR XML PATH('')
	) AS Roles 
FROM {databaseOwner}{objectQualifier}Users U
ORDER BY UserID ASC

 
New Post 8/29/2008 7:56 AM
User is offline jgurley
62 posts
10th Ranked


Re: Simple Report? 

Did I need to wdit something for my specific installation?  I never claimed any expertise!

There was an error executing the data source: There is an error in your SQL at line 13: Line 13: Incorrect syntax near 'XML'.

 
New Post 8/30/2008 3:54 AM
User is offline Lars Tungen
13 posts
10th Ranked


Re: Simple Report? 

All I can say that the query works on my installation. Using DotNetNuke 4.8.4 on SQL Server Express. I can see that the the query sql is not being displayed properly by the forum. Here it is again with another format:

SELECT
    UserID,
    DisplayName,
    Email,
    (
        SELECT
            RoleName + ', '
        FROM
            {databaseOwner}{objectQualifier}Roles R
            INNER JOIN {databaseOwner}{objectQualifier}UserRoles
                UR ON (UR.RoleID=R.RoleID AND UR.UserID=U.UserID)
        WHERE
            (UR.EffectiveDate IS NULL OR UR.EffectiveDate <= getdate())
            AND (UR.ExpiryDate IS NULL OR getdate() < UR.ExpiryDate)
        FOR
            XML PATH('')
    ) AS Roles
FROM
    {databaseOwner}{objectQualifier}Users U
ORDER BY
    UserID ASC

 

 
New Post 8/30/2008 10:19 PM
User is offline jgurley
62 posts
10th Ranked


Re: Simple Report? 

Still failed on my local host (SQL 2005).  It worked perfectly on my live host, so thank you!

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Reports Module ...  Simple Report?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DNNhost Scandinavia
SUPER fast QuadCore DELL servers, MSSQL servers, DotNetPanel, daily backup, Check out our customers websites
DNNhost.dk
Personify Design, Inc.
Seattle-based Personify Design has developed customized DotNetNuke websites for a wide range of customers to meet many different types of needs, including distributed authorship across thousands of pages to integrated Verisign e-commerce capabilities.
www.personifydesign.com
DNN Outsourcing
50% more affordable services comparing to Western Europe and US: Custom DotNetNuke module development, skins, consulting, maintainence... Over 15.000 working hours of experience in custom DotNetNuke Solutions development, 8 years experience in outsourcing, excellent references!
www.dnnoutsourcing.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP