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  |  

  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Reports Module ...  Useful Reports!
Previous Previous
 
Next Next
New Post 8/29/2006 12:26 PM
User is offline Andrew Nurse
343 posts
8th Ranked






Useful Reports! 
Modified By Andrew Nurse  on 9/29/2006 1:49:48 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 7:17 AM
User is offline Dennis Ryan
4 posts
10th Ranked


Re: Favourite Reports? 

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 10:48 AM
User is offline Andrew Nurse
343 posts
8th Ranked






Re: Favourite Reports? 
Modified By Andrew Nurse  on 12/30/2006 12:33:54 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 8:24 AM
User is offline Andrew Nurse
343 posts
8th Ranked






Re: Favourite Reports? 
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

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Reports Module ...  Useful Reports!
 


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.

 


MaximumASP
MaximumASP provides a wide array of web hosting plans to fit any hosting need. We also provide software and services needed to keep it running optimally.
MaximumASP.com
Mad Development: dotnetnuke design and development
We are an expert Dotnetnuke shop specializing in developing solutions that merge the requirements of design and branding, content management, ecommerce, search engine optimization and business logic.
www.MadDevelopment.com
telerik
telerik r.a.d.controls suite is the most innovative and comprehensive toolset for ASP.NET development, tailored for seamless integration with the DotNetNuke project. This integrated collection of controls allows professionals to build web-solutions with the UI richness and responsiveness of desktop applications.
dnn.telerik.com

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