Hey Keith Stone, I may have two answers for you. The first (hopefully the easiest) is to download the reports module and it is free.. I use it a lot for what you are talking about. It gives you a section (under settings) to write a select statement then outputs it in a viewable table format. AN example of this that I use is: One of my select statement: SELECT u.Email, upd.FirstName, upd.LastName, upd.Telephone, Upd.Committee FROM dbo.Users AS u LEFT OUTER JOIN (SELECT up.UserID, MAX(CASE WHEN ppd.PropertyName = 'FirstName' THEN up.PropertyValue ELSE '' END) AS FirstName, MAX(CASE WHEN ppd.PropertyName = 'LastName' THEN up.PropertyValue ELSE '' END) AS LastName, MAX(CASE WHEN ppd.PropertyName = 'Telephone' THEN up.PropertyValue ELSE '' END) AS Telephone, MAX(CASE WHEN ppd.PropertyName = 'Committee' THEN up.PropertyValue ELSE '' END) AS Committee FROM dbo.UserProfile AS up INNER JOIN dbo.ProfilePropertyDefinition AS ppd ON up.PropertyDefinitionID = ppd.PropertyDefinitionID and ppd.PortalID = 0 Group By up.UserID) as upd on u.UserID = upd.UserID Where Upd.Committee >' ' ORDER BY Committee The output is like this: ________________________________________________________________________________ |___email______________|FirstName___|LastName___|Phone Number_|Committee____________| |myemail@domain.com |Scott |Price | (123)555-1234 |Website Committee | |---------------------------------------------------------------------------------------------------------------------------------------------| |myemail2@domain.com |Bill | Sanders | (123555-1111 |Association Committee | ---------------------------------------------------------------------------------------------------------------------------------------------- The other, would be to give you an example of a module I am creating, that works up to now, but I'm not done with it. I am using the module creator. It is a bit tedious and time consuming, but you get the module to do what you want it to and that is worth its weight in gold to me. I can either email/message it to you (as it does not show up great in the forms) or you can find most of it here:
http://stackoverflow.com/questions/22... The only problem with the stack overflow link is that people have messed with the script so much that it will not work if copied and pasted. I can email/message you the files that I have created to see an example. This will give you the basic building blocks for building a module. I had looked everywhere for a tutorial on it and there was nothing worth wile out there. I self taught myself through trial and error over some time. If you need explaining of what is what and how to make a custom module work I can try my best to explain it....... The script that I wrote basically outputs/looks like this: Send Mail To: (?) [___________] Send Mail From: (?) [__________] Subject: (?) [__________] _______________ Message:(?) | | | | | | |_______________ | ________________ [Send Email Button] --------------------------- Let me know if either of these answers can help you or what else I can do to help!! Here is my scripts but I dobt they will show up right:
View.ascx
<%@ Control Language="C#" AutoEventWireup="false" Inherits="Scott.SendEmail.View" CodeFile="View.ascx.cs" %> <%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %> <%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx"%>
View.ascx.rs
Send Mail To: Select who you would like to send email to. Seporate by mutlple addresses with a ; Email Subject: Enter the subject for the email you are sending. Email Message: Enter the Message for the email you are sending. view.ascx.cs
#region Copyright // // Copyright (c) 2014 // by Scott // #endregion #region Using Statements using System; using DotNetNuke.Entities.Modules; #endregion namespace Scott.SendEmail { public partial class View : PortalModuleBase { #region Event Handlers protected override void OnInit(EventArgs e) { base.OnInit(e); cmdSave.Click += cmdSave_Click; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!Page.IsPostBack) { txtField.Text = (string)Settings["field1"]; } } protected void cmdSave_Click(object sender, EventArgs e) { ModuleController controller = new ModuleController(); controller.UpdateModuleSetting(ModuleId, "To", txtField.Text); controller.UpdateModuleSetting(ModuleId, "Subject", txtField2.Text); controller.UpdateModuleSetting(ModuleId, "Message", txtField3.Text); DotNetNuke.Services.Mail.Mail.SendMail( "Admin@MarltonLakes.com",txtField.Text, String.Empty,txtField2.Text, txtField3.Text, String.Empty, "html" , String.Empty,String.Empty,String.Empty, String.Empty);Response.Redirect("http://www.MarltonLakes.com"); } #endregion } }
Settings.Ascx
<%@ Control Language="C#" AutoEventWireup="false" Inherits="Scott.SendEmail.Settings" CodeFile="Settings.ascx.cs" %> <%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
Settings.ascx.res
Default email address Enter the default email address. SQL input: SQL Help
Settings.ascx.cs
#region Copyright // // Copyright (c) 2014 // by Scott // #endregion #region Using Statements using System; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Exceptions; #endregion namespace Scott.SendEmail { public partial class Settings : ModuleSettingsBase { #region Base Method Implementations public override void LoadSettings() { try { if (!Page.IsPostBack) { txtField1.Text = (string)TabModuleSettings["field1"]; } } catch (Exception exc) // Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } } public override void UpdateSettings() { try { ModuleController controller = new ModuleController(); controller.UpdateTabModuleSetting(TabModuleId, "field1", txtField1.Text); } catch (Exception exc) // Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } } #endregion } }