From 5ebcefa9899f60e57704b6db414177c72f4d020b Mon Sep 17 00:00:00 2001 From: Michael Durthaler Date: Sun, 20 May 2018 22:21:24 -0400 Subject: [PATCH] Hard coded username working, left in the AutoExecuteReport for now. --- ViewReports.ascx.vb | 9 +++++++++ Visualizers/Grid/Visualizer.ascx.vb | 26 +++++++++++++------------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ViewReports.ascx.vb b/ViewReports.ascx.vb index 8c2c107..cddef1d 100644 --- a/ViewReports.ascx.vb +++ b/ViewReports.ascx.vb @@ -139,6 +139,15 @@ Namespace DotNetNuke.Modules.DTSReports Private Function AutoExecuteReport(ByVal ctlVisualizer As VisualizerControlBase, ByVal report As ReportInfo, ByRef results As DataTable, ByVal fromCache As Boolean) As Boolean Try results = ReportsController.ExecuteReport(report, String.Concat(ReportsController.CACHEKEY_Reports, ModuleId), report.CacheDuration <= 0, Me, fromCache) + Dim newView As DataTable = results.Clone() + For Each row As DataRow In results.Rows + Dim s As String = row.Item("User Name").ToString() + If row.Item("User Name").ToString() = "Jennifer Stavale" Then + Dim newRow As DataRow = row + newView.ImportRow(newRow) + End If + Next + results = newView Catch ex As DataSourceException ' Display the error message to host users only If Me.UserInfo.IsSuperUser Then diff --git a/Visualizers/Grid/Visualizer.ascx.vb b/Visualizers/Grid/Visualizer.ascx.vb index b31cbb3..13b1575 100644 --- a/Visualizers/Grid/Visualizer.ascx.vb +++ b/Visualizers/Grid/Visualizer.ascx.vb @@ -151,19 +151,19 @@ Namespace DotNetNuke.Modules.DTSReports.Visualizers.Grid view.Sort = String.Format("{0} {1}", Me.SortExpr, Me.SortDir) End If 'durthaler added code - 'Dim beginDate As String = "" - 'Dim endDate As String = "" - 'Dim selectedName As String = "" - 'Dim newView As DataView = New DataView - 'If Session("selectedName") IsNot Nothing Then - ' selectedName = Session("selectedName").ToString() - 'End If - 'If Session("beginDate") IsNot Nothing Then - ' beginDate = Session("beginDate").ToString() - 'End If - 'If Session("endDate") IsNot Nothing Then - ' endDate = Session("endDate").ToString() - 'End If + Dim beginDate As String = "" + Dim endDate As String = "" + Dim selectedName As String = "" + Dim newView As DataView = New DataView + If Session("selectedName") IsNot Nothing Then + selectedName = Session("selectedName").ToString() + End If + If Session("beginDate") IsNot Nothing Then + beginDate = Session("beginDate").ToString() + End If + If Session("endDate") IsNot Nothing Then + endDate = Session("endDate").ToString() + End If 'For Each row As DataRowView In view ' Dim name = CStr(row("User Name")) ' If name = selectedName Then