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  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Reports Module ...  Use address bar as parameter?
Previous Previous
 
Next Next
New Post 2/4/2008 9:55 AM
User is offline Jaco Vosloo
8 posts
www.furyx.net
10th Ranked


Re: Use address bar as parameter? 

Hi, This is the code I use to get parameter support. At the moment I must switch off friendly URLs in Host settings because I don’t yet know how to use NavigateURL. The changes are in App_Code\Reports\ReportsController.vb. This is for version 4.05 although it should work for 5 as well. 

Regards Jaco Vosloo

 
Original:

        Public Shared Function BuildParameters(ByVal SrcModule As PortalModuleBase) As DbParameter()

            Return New SqlParameter() {BuildIntParam("@PortalID", SrcModule.PortalId), BuildIntParam("@TabID", SrcModule.TabId), _

                BuildIntParam("@ModuleID", SrcModule.ModuleId), BuildIntParam("@UserID", SrcModule.UserId)}

        End Function
 
New:

        Public Shared Function BuildParameters(ByVal SrcModule As PortalModuleBase, ByVal Query As String) As DbParameter()

            Dim tmpParameterName As String

            Dim tmpArray As New ArrayList

            Dim IndexStart, IndexEnd As Integer

            IndexStart = Query.IndexOf("@", 0)
            Do While IndexStart >= 0
                IndexEnd = Query.IndexOf(" ", IndexStart)

                If IndexEnd < 0 Then IndexEnd = Query.Length

                tmpParameterName = Query.Substring(IndexStart + 1, IndexEnd - IndexStart - 1)

                tmpArray.Add(BuildParameter(SrcModule, tmpParameterName))

                IndexStart = Query.IndexOf("@", IndexEnd)
            Loop

            Return CType(tmpArray.ToArray(GetType(DbParameter)), DbParameter())

        End Function
 

        Private Shared Function BuildParameter(ByVal SrcModule As PortalModuleBase, ByVal ParameterName As String) As SqlParameter

            Dim tmpValue As String

            Dim tmpParameter As SqlParameter = Nothing

            Dim thisrequest As HttpRequest = HttpContext.Current.Request

            Dim AddBlankParameters As Boolean = True

            Select Case ParameterName

                Case "PortalID"

                    tmpParameter = BuildIntParam("@PortalID", SrcModule.PortalId)

                Case "TabID"

                    tmpParameter = BuildIntParam("@TabID", SrcModule.TabId)

                Case "ModuleID"

                    tmpParameter = BuildIntParam("@ModuleID", SrcModule.ModuleId)

                Case "UserID"

                    tmpParameter = BuildIntParam("@UserID", SrcModule.UserId)

                Case Else

                    tmpValue = thisrequest.Params(ParameterName)

                    If AddBlankParameters Or Not (tmpValue Is Nothing Or tmpValue = "") Then

                        tmpParameter = New SqlParameter("@" + ParameterName, tmpValue)

                    End If

            End Select

            Return tmpParameter

        End Function
 
New Post 2/4/2008 11:47 AM
User is offline Andrew Nurse
353 posts
8th Ranked






Re: Use address bar as parameter? 

Very cool, thanks for posting that! As I said, I hope to have a parameter system in the next version but that's a nice little work around.


Andrew Nurse
DotNetNuke Core Team Member and Reports Module Project Lead
Microsoft Certified Professional Developer

 
New Post 2/16/2008 12:24 PM
User is offline Henrik Larsen
9 posts
10th Ranked


Re: Use address bar as parameter? 

Hi,

Just want to come up with an idea for this.

You can use a user defined table to set some parameters, since the report can join from the UDT to get its parameters.

It may not be as dynamic as you need to, but this may be a usefull trick for others as well.

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Reports Module ...  Use address bar as parameter?
 


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.

 


PointClick.Net DNN Solutions
DotNetNuke Hosting Platform for Business and personal use.
PointClick.Net Hosted Solutions
Advanced Web Portals by Infoscaler
Infoscaler is a California based company that provides advanced Web Portals, E-commerce Sites, Database Applications and Intranet Solutions on the DotNetNuke and Microsoft.NET platforms.
www.infoscaler.com
DotNetNuke® in Sweden
All service of DotNetNuke® in Sweden.
Olsmar Konsult

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