Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // <reference path="http://localhost:5378/Scripts/jquery-1.4.1-vsdoc.js" />
- var pubReportName = "";
- $(function () {
- pubReportName = "";
- $("#bttnPrint").click(PrintReport_Click);
- $('#txtFrDate').val('');
- $('#txtToDate').val('');
- $("#txtFrDate").datepicker({ dateFormat: 'dd/mm/yy' });
- $("#txtToDate").datepicker({ dateFormat: 'dd/mm/yy' });
- $('#ReportLeftDiv li').click(function () {
- // remove all active classes
- $('#ReportLeftDiv li').removeClass('active');
- $(this).addClass('active');
- });
- function PrintReport_Click() {
- var repName = $('#ReportLeftDiv li.active').attr('id');
- if (repName == undefined || repName == null) {
- alert("Please choose the Report name");
- return false;
- }
- var ReportParameters = new Array();
- var StDt = $('#txtFrDate').val();
- var EndDt = $('#txtToDate').val();
- ReportParameters.push({ ReportName: "/LISReportProject/" + repName, ParaName: "pStartDate", ParaValue: StDt });
- ReportParameters.push({ ReportName: "/LISReportProject/" + repName, ParaName: "pEndDate", ParaValue: EndDt });
- sessionStorage.setItem('ReportParameters', JSON.stringify(ReportParameters));
- // ShowHideProcessingDivs('SHOW');
- fnPrintResult();
- var data1 = JSON.stringify({ ReportParameters: ReportParameters });
- $.ajax({
- cache: false,
- type: "POST",
- url: "WCF/LabStatusService.svc/SetSessionValues",
- data: data1,
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- processType: false,
- success: fnPrintResult,
- failure: onErrorFunction
- });
- function fnPrintResult()
- {
- $.PrintPreview("LAB Statistics Report", "../PrintPreview.aspx");
- function onErrorFunction(result) {
- //document.getElementById('divWait').style.visibility = "hidden"
- //ShowHideProcessingDivs('SHOW');
- PopupMessage("Error", result.d, 'Alert');
- function ShowHideProcessingDivs(ShowHide) {
- switch (ShowHide) {
- case 'SHOW':
- $('#divWait').removeClass('#overlay').addClass('').show();
- if ($('#Processing').hasClass("Processing"))
- $('#Processing').removeClass("Processing");
- $('#Processing').addClass("Processing").show();
- break;
- case 'HIDE':
- $('#divWait').hide();
- $('#Processing').hide();
- break;
- }
- $('#txtFrom').datepicker({
- inline: true,
- dateFormat: 'dd/mm/yy'
- });
- $('#txtTo').datepicker({
- inline: true,
- dateFormat: 'dd/mm/yy'
- });
- function com() {
- var start = $('#txtFrom').val();
- var to = $('#txtTo').val();
- if (new Date(to) >= new Date(start)) {
- $('#result').text("To date is greater than or equal to start");
- }else{
- $('#result').text("To date is less than to start");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement