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 ForumsRepositoryRepositoryExtending the Repository with Top Categories by DownloadsExtending the Repository with Top Categories by Downloads
Previous
 
Next
New Post
8/11/2006 7:15 PM
 

If you are using the Repository Module it may be useful to display the Categories and how many Downloads each Category has received.

Anyway here is how I did it:

1. Create a Stored Procedure to display the Top 10 Categories by number of Downloads:

CREATE PROCEDURE [dbo].[grmGetTopCategoriesByDownload] AS

BEGIN

 DECLARE @xTotalDownloads int

 SELECT @xTotalDownloads = sum(Downloads) FROM dbo.grmRepositoryObjects

 SELECT TOP 10 [Categories].[Category] as Category,
   sum([Objects].[Downloads]) as DownloadCount,
   sum([Objects].[Downloads]) * 100 / @xTotalDownloads as Percentage

 FROM
  dbo.grmRepositoryCategories as Categories,
  dbo.grmRepositoryObjects as Objects,
  dbo.grmRepositoryObjectCategories as ObjectCategories

 WHERE
  [Categories].[ItemId] = [ObjectCategories].[CategoryID] and
  [ObjectCategories].[ObjectID] = [Objects].[ItemID] and
  [Categories].[Category] <> 'ALL'

 GROUP BY
  [Categories].[Category]

 ORDER BY
  DownloadCount DESC

END
GO

2. Execute this procedure

Query:

exec dbo.grmGetTopCategoriesByDownload

3. Format the Result to your liking. I was using the ListX module from www.bi4ce.com
and this is my setup for the formatting of the results in the ListX module:

Header Group:
<table width=100% >
<tr bgcolor= #5ebeff ><td>Category</td><td align=center>Visits</td><td align=right> %</td></tr>

Footer Group:
</table>

Detail Item:
<tr>
 <td>[Category]</td><td align=center>[DownloadCount]</td><td align=right >[Percentage] %</td>
</tr>

Alternate Item:
<tr bgcolor=#c0c0c0 >
 <td>[Category]</td><td align=center>[DownloadCount]</td><td align=right >[Percentage] %</td>
</tr>

The results can be seen on this Fun with DNN Statistics page of the DotNetNuke Websites Directory

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryExtending the Repository with Top Categories by DownloadsExtending the Repository with Top Categories by Downloads


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