Skip to content

Commit

Permalink
Got the dates, etc working
Browse files Browse the repository at this point in the history
Issue to resolve is why the report link has to be clicked 2 times to see parameter changes.
  • Loading branch information
PostalMike committed May 28, 2018
1 parent c764a59 commit ef22353
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
8 changes: 1 addition & 7 deletions ViewReports.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,15 @@
<asp:TextBox ID="txtEndingDate" runat="server"></asp:TextBox>
<p>
<asp:LinkButton ID="RunReportButton" runat="server" ResourceKey="RunReportButton"
CssClass="CommandButton" EnableViewState="false" OnClientClick="MyNewFunction()" />&nbsp;
CssClass="CommandButton" EnableViewState="false" />&nbsp;
<asp:LinkButton ID="ClearReportButton" runat="server" ResourceKey="ClearReportButton"
CssClass="CommandButton" Visible="false" EnableViewState="false" />
</p>
</asp:PlaceHolder>
<asp:PlaceHolder ID="VisualizerSection" runat="server" />
<script type="text/javascript">
$(function () {
var newDate = new Date();
var defDate = ((newDate.getMonth() + 1) + '/' + (newDate.getDate() - 7) + '/' + newDate.getFullYear());
$("#<%= txtStartDate.ClientID %>").datepicker();
$("#<%= txtStartDate.ClientID %>").datepicker('setDate', defDate);
$("#<%= txtEndingDate.ClientID %>").datepicker();
$("#<%= txtEndingDate.ClientID %>").datepicker('setDate', 'today');
});
</script>
10 changes: 5 additions & 5 deletions ViewReports.ascx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ Namespace DotNetNuke.Modules.DTSReports
End If
'durthaler added code
If Not IsPostBack Then
txtStartDate.Text = DateTime.Now.AddDays(-7).ToShortDateString()
txtEndingDate.Text = DateTime.Now.ToShortDateString()
LoadUsers()
End If

Expand All @@ -249,24 +251,23 @@ Namespace DotNetNuke.Modules.DTSReports
GROUP BY
USER_NAME

ORDER BY
USER_NAME
"
Dim sqlResult As String = sqlSelect + sqlWhere + sqlUser + sqlGroupBy
mc.UpdateModuleSetting(ModuleId, "dnn_ReportsDS_DotNetNuke_Query", sqlResult)
'end durthaler added code
If ClearReportButton.Visible = False Then
RunReport()
'ClearReportButton.Visible = True
ClearReportButton.Visible = True
If Report.AutoRunReport Then
RunReport()
End If
End If

End Sub
Dim selUser As String = ""
'Dim isUsersLoaded As Boolean = False
Private Sub LoadUsers()
For Each ui As Entities.Users.UserInfo In Entities.Users.UserController.GetUsers(PortalId)
'If ui.IsInRole("Registered Users") And ui.UserID > 2 Then
If ui.UserID > 2 Then
Dim li As ListItem = New ListItem
li.Text = ui.FullName
Expand All @@ -275,7 +276,6 @@ Namespace DotNetNuke.Modules.DTSReports
End If
Next
ddlUserName.DataBind()
'isUsersLoaded = True
End Sub
Private Sub RunReportButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RunReportButton.Click
If ClearReportButton.Visible = True Then
Expand Down

0 comments on commit ef22353

Please sign in to comment.