vendredi 14 mars 2014

SSRS - jQuery Datepicker issue for Chrome


Vote count:

0




The datepicker does not show up for SSRS datetime parameters in Chrome. I managed to download the project from this Codeproject article and it works fine. However, when I add the same code to my solution, it does not work. I'm stumped. The only difference between the sample project and the file in my solution is that one is a website, and the other is a web application (datepicker works in the website). Reproducing the entire code below.


ASPX:



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebForm1" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<html>
<head runat="server">
<title>View Report</title>
<link rel="stylesheet" href="http://ift.tt/NI8b2a" />
<script src="http://ift.tt/Qr28dm"></script>
<script src="http://ift.tt/ZkHp0Z"></script>
<style type="text/css">
html, body, form {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
font-family: Verdana, Tahoma, Arial;
font-size: small;
}
</style>
</head>
<body>
<form id="frmReportViewer" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div id="divMain">
<rsweb:ReportViewer BackColor="#dee7f2" ID="rvREXReport" runat="server" Font-Names="Verdana" Font-Size="8pt" ProcessingMode="Remote" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Height="700px" Width="986px" ShowCredentialPrompts="False" ShowZoomControl="False" SizeToReportContent="True" Style="display: table !important; margin: 0px; overflow: auto !important;" AsyncRendering="false" PageCountMode="Actual"></rsweb:ReportViewer>

</div>

</form>
<script type="text/javascript">

function pageLoad() {
$(function () {
$.browser.chrome = $.browser.webkit;
//if ($.browser.chrome) {
showDatePicker();
//}
});
}

function showDatePicker() {
var parameterRow = $("#ParametersRowrvREXReport");
var innerTable = $(parameterRow).find("table").find("table");
var span = innerTable.find("span:contains('Start Date')");
if (span) {
var innerRow = $(span).parent().parent();
var innerCell = innerRow.find("td").eq(1);
var textFrom = innerCell.find("input[type=text]");
innerCell = innerRow.find("td").eq(4);
var textTo = innerCell.find("input[type=text]");
$(textFrom).datepicker({
dateFormat: 'mm/dd/yy',
changeMonth: true,
numberOfMonths: 1,
onClose: function (selectedDate) {
$(textTo).datepicker("option", "minDate", selectedDate);
}
});
$(textFrom).focus(function (e) {
e.preventDefault();
$(textFrom).datepicker("show");
});
$(textTo).datepicker({
dateFormat: 'mm/dd/yy',
changeMonth: true,
numberOfMonths: 1,
onClose: function (selectedDate) {
$(textFrom).datepicker("option", "maxDate", selectedDate);
}
});
$(textTo).focus(function () {
$(textTo).datepicker("show");
});
}
}
</script>
</body>
</html>


Code-behind:



using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Web.Configuration;
using System.Web.UI;
using Weirspm.Amp.Framework.Infrastructure.Security;


public partial class WebForm1 : System.Web.UI.Page
{
private string _reportName;
protected void Page_Load(object sender, EventArgs e)
{
_reportName = "SomeReport";
this.Page.Title = _reportName;
if ((!Page.IsPostBack))
{

// Set the report server URL and report path
string _reportServerUrl = ConfigurationManager.AppSettings["REPORT_SERVER_PATH"];
string _reportPath = ConfigurationManager.AppSettings["REPORT_SERVER_FOLDER_PATH"];
string _userName = CryptoHelper.Decrypt(WebConfigurationManager.AppSettings["ReportCredentialsUsername"]);
string _pasword = CryptoHelper.Decrypt(WebConfigurationManager.AppSettings["ReportCredentialsPassword"]);
// Set the processing mode for the ReportViewer to Remote
rvREXReport.ProcessingMode = ProcessingMode.Remote;
ServerReport serverReport = rvREXReport.ServerReport;
rvREXReport.ServerReport.ReportServerCredentials = new ReportViewerCredentials(_userName, _pasword);
serverReport.ReportServerUrl = new Uri(_reportServerUrl);
serverReport.ReportPath = _reportPath + _reportName;
string userId = "1";
List<ReportParameter> parameters = new List<ReportParameter> { new ReportParameter("UserId", userId) };
rvREXReport.ServerReport.SetParameters(parameters);
}
}
}


asked 2 mins ago

Fahad

343





Aucun commentaire:

Enregistrer un commentaire