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 ForumsReportsReportsWhatWhat's New Script for Reports Module
Previous
 
Next
New Post
5/2/2008 1:24 PM
 

I was in need of the What's New module which I soon discovered was no longer supported so I whipped up my own, rather quickly.  You can use this as a starting point to build your own for your own needs without having to reinvent the wheel too much.

I have used a stored procedure because of a size restriction on the field for the report SQL statement.

In addition to the stored procedure, you will need the following settings at a minimum in the report module:

Query:  exec myprefix_WhatsNew

HtmlDecode: Content

The formatting of this report is rather crude but there are options in the reporting module to clean that up if you want.

You will want to look at each of the queries in this script to customize them for your needs.  In the portal that I wrote this for, there is only one tab with a blog module and only one tab with the forums module so I hard-coded those tab IDs.  You may need to make those dynamic.

This What's New? report will work (with modifications for your portal) with the following "out-of-the-box" DNN modules:

  • Text/HTML
  • Announcements
  • Wiki
  • Blog
  • Discussions

You can expand/contract it as needed to work with modules of your choice.

Stored Procedure (Name it to what you want, of course):

create procedure myprefix_WhatsNew
as
select top 50
	'Link' as LinkTo,
	substring(wt.Content, 1, 150) as [Content],
	substring(tb.Title, 1, 30) as [Page Title],
	wt.UpdateDate as Date
from 
	wiki_topic wt,
	tabmodules tm,
	Tabs tb
where 
	wt.moduleid = tm.moduleid and
	tm.tabid = tb.tabid

union all

select top 50
	'Link' as LinkTo,
	substring(ht.desktophtml, 1, 100)  as [Content],
	substring(tb.Title, 1, 30) as [Page Title],
	ht.CreatedDate as Date
	
from 
	htmltext ht,
	tabmodules tm,
	Tabs tb
where 
	ht.moduleid = tm.moduleid and
	tm.tabid = tb.tabid

union all

select top 50
	'Link' as LinkTo,
	substring(an.Title, 1, 100)  as [Content],
	substring(tb.Title, 1, 30) as [Page Title],
	an.PublishDate as Date
	
from 
	Announcements an,
	tabmodules tm,
	Tabs tb
where 
	an.moduleid = tm.moduleid and
	tm.tabid = tb.tabid

union all

select top 50
	'Link' as LinkTo,
	substring(be.Entry, 1, 100)  as [Content],
	substring(bb.Title, 1, 30) as [Page Title],
	be.AddedDate as Date
from 
	Blog_Entries be,
	Blog_Blogs bb,
	Tabs tb
where 
	be.blogid = bb.blogid and
	tb.tabid = 55

union all

select top 50
	'Link' as LinkTo,
	substring(fp.Subject, 1, 100)  as [Content],
	'Discussion Forum - ' + substring(ff.Name, 1, 30) as [Page Title],
	fp.UpdatedDate as [Date]
from 
	Forum_Posts fp,
	Forum_Threads ft,
	Forum_Forums ff
where 
	fp.ThreadID = ft.ThreadID and
	ft.ForumID = ff.ForumID

order by Date desc
 
New Post
5/3/2008 8:22 AM
 

Thanks Steven i do a reply to a searched post only to find out that someone posted about it 4 hours previous.

For a complete n00b, are you meaning that with it being a stored proceedure, i can't paste it into the SQL Query area of the Reports module? OR do the SQL query area allow for "stored Procedures"?

Thanks in advance,

Dean

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsWhatWhat's New Script for Reports Module


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