Recently Viewed...
To help you navigate to pages you most recently visited, select from the links below.
Product Forums
Sharepoint Forums
Migrate to DotNetNuke
DNN Modules
SnowCovered Top Sellers

Ultra Media Gallery 5.3
Ultra Media Gallery is the most popular photo gallery and media gallery module for DotNetNuke, the major purpose of this module is to allow you create unlimited pictures and medias to your gallery and organize them by albums, your albums and medias are browsed in flash interface.

Ultra Video Gallery 2.3
Ultra Video Gallery is a brother product of Ultra Media Gallery, The major purpose of this product is to provide an easy way to add videos in various formats to your website by and play them in a unique flash gallery.

Flex By DrNuke
The Flex skins are professionally designed, coded and packaged by a team of DotNetNuke experts. Available in 8 great colours, each with 15 banner images, 2 menu types and a choice of 3 background styles. The entire pack features a total of 2472 skins!

Engage: Publish 5.1
Content Workflow + Versioning + Categorization + Multiple Display Options = Truly Advanced DotNetNuke Content Management (Requires DNN 4.5.1 or later)

XMod 5.1
Version 5 of the perennial best-selling tool for creating data-based solutions in DNN without custom programming. This version focuses on greater flexibility, expandability, and ease-of-use.

Events Calendar and Registration 2.1.8 for DNN4.xx
One stop solution for events calendar and events registration! Demo site available for free trial.

Open-DocumentLibrary v3.0
Powerful, Ajax Enabled, Easy to Use. Document Management has never been better. Open-DocumentLibrary allows DotNetNuke users to share and manage documents in a flexible, intelligent way, offering granular control over Folder and Document access.

DNNMasters SEO Suite Enterprise w/Source
If you want better Search Engine ranking you need KeepAlive, URL Rewrite, Custom 404 error, Custom Redirect, Friendly URL's, Sitemap, Google Sitemap.DNNMasters SEO Suite delivers all of it and more!

Form Master 1.6 For DNN 4
Form Master 1.6 improves on the success of version 1.5 with new features in Function, and Presentation, while maintaining the Intuitive User Interface. Form Master 1.6 delivers visual form design where input fields can easily be created, modified, and moved.

Document Exchange Professional 4
Edit documents directly on your server using the latest iteration of the premier document management solution for DotNetNuke (DNN). With a completely revised Ajax-enabled UI.
    |   Register   |   Friday, September 05, 2008   
Data Springs Product Forums...
Subject: Trying to add UserID to Demonstration 13
Prev Next
You are not authorized to post a reply.

Author Messages
John
Posts:1
new to the springs
new to the springs

07/20/2008 3:24 PM  

I am trying to add the form parameter user id to the sql query in demonstration 13.

Can someone modify this sproc to include the USERID on the Form.  I would like to pass the moduleid and the userid

What is the proper way to pass that variable from a Dynamic Form

Thanks,

Here is the sproc in the example.

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

CREATE  Procedure [dbo].[DynamicForms_ExportFormResults_ForTraining]

@ModuleID int

AS


Declare curBubba Cursor
FOR
SELECT Question, DynamicQuestionID
FROM dynamicforms_question 
where QuestionType <> 'HTML' 
AND QuestionType <> 'HR' 
AND InActive=0 
AND ModuleID = 1113
AND Question <> 'Postal Code' 

ORDER BY SortOrder
FOR READ ONLY;

Declare @Question VarChar(500);
Declare @DynamicQuestionID uniqueidentifier;
Declare @SQLToUse VarChar(8000);
Declare @SQLToUseJoin VarChar(8000);
Declare @SQLToExecute Varchar(8000);
Declare @Alias 	  VarChar(10);

Declare @intCounter Int;

set @Question = '';
set @SQLToUse = '';
set @intCounter = 0;
set @Alias = '';
set @SQLToUseJoin = '';

OPEN curBubba;
FETCH NEXT FROM curBubba INTO @Question, @DynamicQuestionID;

WHILE @@FETCH_STATUS = 0
BEGIN

	set @intCounter = @intCounter + 1;

	set @Alias = '[RJoin_' + CAST(@intCounter as varchar(20)) + ']';

	if DataLength(@SQLToUse) = 0
	BEGIN
		set @SQLToUse = 'SELECT IsNull(' + @Alias + '.response,''N/A'') as [' + @Question + '] '
		set @SQLToUseJoin = ' 
From (
  SELECT  distinct Y.uniqueresponseID, Y.UserID, B.UserName
  from [DynamicForms_QuestionResponse] As Y
  inner join DynamicForms_Question  as Z on (Y.DynamicQuestionID = Z.DynamicQuestionID)
  Left Outer Join Users B on B.UserID = Y.UserID 
  where Z.ModuleID = ' + Cast(@ModuleID as varchar(20)) + ' 
) As A 
Left Outer join DynamicForms_QuestionResponse as ' + @Alias + ' on (A.uniqueresponseID = ' + @Alias + '.uniqueresponseID and ''' + Cast(@DynamicQuestionID as varchar(50))+ ''' = ' + @Alias + '.DynamicQuestionID)
'
	END
	ELSE
	BEGIN
		set @SQLToUse = @SQLToUse + ', ' + @Alias + '.response as [' + @Question + '] '
		set @SQLToUseJoin = @SQLToUseJoin + 'Left Outer join DynamicForms_QuestionResponse as ' + @Alias + ' on (A.uniqueresponseID = ' + @Alias + '.uniqueresponseID and ''' + Cast(@DynamicQuestionID as varchar(50))+ ''' = ' + @Alias + '.DynamicQuestionID) 
'
	END;	

   	FETCH NEXT FROM curBubba INTO @Question, @DynamicQuestionID;
END

CLOSE curBubba;
DEALLOCATE curBubba;

Set @SQLToExecute = Convert(varchar(8000), @SQLToUse) + Convert(varchar(8000), @SQLToUseJoin) 

--set @SQLToExecute = @SQLToUse + @SQLToUseJoin 
--print @SQLToExecute
EXEC(@SQLToExecute);

 

You are not authorized to post a reply.
Forums > Product Discussion - DotNetNuke Modules > Dynamic Forms > Trying to add UserID to Demonstration 13



ActiveForums 3.7

Copyright 2005 - 2008 by Data Springs, Inc.
Terms Of Use | Privacy Statement