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  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
 


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.

 


FREE Skins, Modules & Control Panel!
Choose how much you want to pay on our Skins, Modules, Containers and Control Panel - Starting from FREE!
www.dnngroup.com
Disgrafic
Diseño y creación de portales web dinámicos :: Desarrollo de módulos personalizados :: Soluciones a medida :: Imagen Corporativa :: Tu proveedor DNN en España
www.disgrafic.com
DM Analytics, LLC
DM Analytics, LLC provides software solutions that facilitate rapid development of independent or dependent datamarts and their associated web-based reporting.
www.dmanalytics.com

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