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  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


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
345 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.

 


EMAS Pro
Strategic Enrollment Management Software for Higher Education Recruitment, Retention and Financial Aid
www.emaspro.com
Subzero Solutions
Dutch / English DotNetNuke consultancy services. Custom module development in any version. Complete application integration. Small business portal hosting. Your ideas our innovation - Your success our motivation. K.v.k Amsterdam: 34236342
www.subzero-solutions.net
Hosting for DotNetNuke
SiteGround.com is the best place to host your DotNetNuke website! Expert DotNetNuke support, reliable servers, low price!
www.SiteGround.com

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