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 ForumsReportsReportsUseful Reports!Useful Reports!
Previous
 
Next
New Post
8/29/2006 3:26 PM
 
Lots of people are using the Reports module in interesting ways. Post the SQL Scripts you use to display your DotNetNuke data in different ways (don't post anything confidential of course). Reply to this thread with your Script and a description of what it does if you want to share it with the community!

EDIT: I've locked this thread, if you have a report to recommed please post a new thread with the details

Andrew Nurse
DotNetNuke Core Team Member and Reports Module Project Lead
Microsoft Certified Professional Developer

 
New Post
9/12/2006 10:17 AM
 

Has anyone written Reports against the UDT? I am having trouble figuring out the SQL for what the table name would be.

Any help would be appreciated.

 
New Post
9/29/2006 1:48 PM
 
Name: Top 10 Last Forum Posts

Info: First, replace "yourserver/dotnetnuke/forums/tabid/163" with the Url to your Forums page. Second, replace the text "Private" in "Where Forum_Groups.Name <> 'Private'" with the name of any forum group you want to hide from this list you can also simply remove that line to show all forums, and add "AND Forum_Groups.Name <> '...'" to hide other forum groups, you can also use "AND Forum_Forums.Name <> '...'" to hide single forums (NOTE, the first of these conditions must use 'WHERE', the rest should use 'AND').

SQL Query (for v4.3.1)
SELECT TOP 10  
'<a href="http://yourserver/dotnetnuke/forums/tabid/163/forumid/' +
CAST(Forum_Forums.ForumID as varchar(3)) + 
'/threadid/' +
CAST(Forum_Threads.ThreadID as varchar(3)) + 
'/scope/posts/Default.aspx">' + 
Forum_Posts.Subject + 
'</a>'
FROM Forum_Posts 
INNER JOIN Forum_Threads ON Forum_Posts.ThreadID = Forum_Threads.ThreadID 
INNER JOIN Forum_Forums ON Forum_Threads.ForumID = Forum_Forums.ForumId 
INNER JOIN Forum_Groups ON Forum_Forums.GroupID = Forum_Groups.GroupID 
WHERE Forum_Groups.Name <> 'Private' 
AND Forum_Forums.IsActive = '1' 
AND Forum_Posts.IsApproved = '1'
ORDER BY CAST(Forum_Posts.PostID as varchar(3)) DESC

Alternate Query, using the HTML Template Renderer in v4.4.2 (again replacing the text "Private" if necessary, as above):
SELECT TOP 10  
Forum_Forums.ForumID as 'ForumID',
Forum_Threads.ThreadID as 'ThreadID', 
Forum_Posts.Subject as 'Subject'
FROM Forum_Posts 
INNER JOIN Forum_Threads ON Forum_Posts.ThreadID = Forum_Threads.ThreadID 
INNER JOIN Forum_Forums ON Forum_Threads.ForumID = Forum_Forums.ForumId 
INNER JOIN Forum_Groups ON Forum_Forums.GroupID = Forum_Groups.GroupID 
WHERE Forum_Groups.Name <> 'Private' 
AND Forum_Forums.IsActive = '1' 
AND Forum_Posts.IsApproved = '1'
ORDER BY CAST(Forum_Posts.PostID as varchar(3)) DESC

Configuring the HTML Template (v4.4.2 ONLY):
Create an HTML File with the following code (replacing http://yourserver.../, as above):
<a href="http://yourserver/dotnetnuke/forums/tabid/163/forumid/[ForumID]/threadid/[ThreadID]">
[Subject]
</
a><br/>

Then upload the file to your Portals/[PortalID] directory (or use the File Manager). Enter the alternate query above into your reports module and select the "HTML Template Visualizer". Pick the HTML file you uploaded and save your changes.

NOTE: This report has not been fully tested so it may have errors, please report any problems you have in the forums, referencing the "TOP 10 Forum Posts Report"

Andrew Nurse
DotNetNuke Core Team Member and Reports Module Project Lead
Microsoft Certified Professional Developer

 
New Post
12/30/2006 12:24 PM
 
Name: # of Users in Role

Info: This report displays a grid, or chart of the number of users in each role

SQL Query:
SELECT r.RoleName as 'Role', COUNT(ur.UserID) as 'Users'
FROM dnn_Roles r
INNER JOIN dnn_UserRoles ur ON r.RoleID = ur.RoleID
GROUP BY r.RoleName

Alternate Query (adding Color per Bar, see below):
SELECT r.RoleName as 'Role', COUNT(ur.UserID) as 'Users',
    (CASE 
        WHEN (COUNT(ur.UserID) > 10) THEN '#00FF00' 
        ELSE '#000000' 
    END) as 'Color'
FROM dnn_Roles r
INNER JOIN dnn_UserRoles ur ON r.RoleID = ur.RoleID
GROUP BY r.RoleName
Note: Change the WHEN (COUNT(ur.UserID) > 10) condition to what ever you wish, and add more conditions which map to different colors as you wish.

Visualizer Configuration:
Using the grid visualizer requires no special configuration. However, if you wish to display a chart, follow these steps:
  1. Ensure the Chart Visualizer is installed (see the DesktopModules\Reports\ExtVisualizers\Install.txt file)
  2. Select the Chart Visualizer from the Visualizers drop down in the Report Settings page
  3. Select either Horizontal Bar Chart, or Vertical Column Chart (the X-Axis/Y-Axis titles must be reversed if you choose Horizontal as this guide will use Vertical)
  4. Enter a Width and Height (any values should do, 400x250 is fairly good, but feel free to use trial and error)
  5. Enter the X-Axis Title: 'Role' (without quotes)
  6. Enter the Y-Axis Title: 'Users in Role' (without quotes, remember to flip these if you choose horizontal bars
  7. Enter the Bar Name Column: 'Roles' (without quotes)
  8. Enter the Bar Value Column: 'Users' (without quotes, these are the column names returned by the SQL Query)
  9. Select "One Color for Every Bar" and enter a color.
  10. OR, if you used the alternate query, select "One Color per Bar" and enter 'Color' as the Bar Color Column (without quotes)

Andrew Nurse
DotNetNuke Core Team Member and Reports Module Project Lead
Microsoft Certified Professional Developer

 
New Post
11/19/2008 11:53 AM
 

Name: Member Roster

Original Author: airpanther [Original Thread]

SQL Query:

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.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'

Description (by airpanther, from thread linked above): This is a simple DNN report... probably been done a lot before, but maybe useful to someone. I use this report for my organizations who want members to have a list of e-mails, phone numbers, and addresses for all other registered members. Obviously this is most useful in a "Private" portal.


Andrew Nurse
DotNetNuke Core Team Member and Reports Module Project Lead
Microsoft Certified Professional Developer

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsUseful Reports!Useful Reports!


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