Friday, September 12, 2014

How to include crystal report in to form in asp.net

Title: Include crystal reports in to form in asp.net

Description :The crystal report can not be executed separately, Hence we can use a windows form to execute the report
Asp.net provides a control i:e CrystalReportViewer which can be used display the crystal report on the form

Steps have to do invoke the crystal report

1.Drag ―CrystalReportViewer control from tool box to specified form

Properties for Report control:

1.Report Source: EmployeeDetailsReport.
2.Run the solution .Then it will ask a authentication ,there you need to enter a code(PWD) to finish the process
While running the application the report viewer provides the format option to display records(PDF,MS word etc)

Sunday, September 7, 2014

How to get and format the date in asp.net using JQuery

As per previous articles we have seen how to get the data from the web controls using JQuery. Here  we will know how format and add the days to desired date in JQuery.

The below piece of code will get the current date and add days(Here 7days) using Jquery.There is one more functionality also included to get the date in a specific format using Date picker function

<asp:Label id="Label1"  Text="Date" runat="server"/>
<asp:TextBox ID="txtDate" runat="server"/>
<asp:Button id="CalDuration" >Calculate</asp:Button></br />




$("#txtDate").datepicker({ dateFormat: 'mm/dd/yy' }); $('#CalDuration').on('click', function(){ var $date = $('#txtDate').datepicker("getDate"); var resDate = new Date(); resDate.setDate($date.getDate() + 7); alert(resDate.toString());

Saturday, May 10, 2014

JQuery Allow specific number of Alphabets into text box in asp.net

Title:Allow only number of Alphabets in to Text box in asp.net using JQuery

Description:
As per previous article ,we have done validation on the text box which has to hold some value while doing the insertion.Now i would like describe and give an example on JQuery validation ,which will allow only 10 characters into text box.So here i will put condition text box length while performing the validation i:e is less then 10 ,it will show error message through alert box

Example:
<html>
<head runat="server">
<script type="text/javascript" src="Javascript/jquery-1.3.1.min.js"></script>
<script type="text/javascript" language="javascript">

$(document).ready(function() {

$('#allowOnlyChars').click(function() {

if ($("#OnlyChars").val().length < 10) {

alert('Valid data'+"#OnlyChars").val());

return true
}
else {
alert('Please: you should enter only 10 characters')
return false;
}
})
});
</script>
</head>
<body>
<form id="validateForm" runat="server">
<asp:TextBox ID="OnlyChars" runat="server"></asp:TextBox>
<asp:Button ID="allowOnlyChars" runat="server" Text="Validate" OnClick="allowOnlyChars_Click" />
</form>
</body>
</html>

Monday, April 28, 2014

JQuery validate textbox in asp.net


Title : How to validate text box using JQuery in asp.net

Description : Why we have to apply validation on input control?Because of this functionality we can restrict the input data as per our need.Now we will see how to do the validation using client side script(JQuery).If we want to develop the validations in asp.net we have to use validation 
control for specified control.

Example:
<html>
<head runat="server">
<script type="text/javascript" src="Javascript/jquery-1.4.1.min.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#doValidate').click(function() {
if ($("#allowData").val()!="") {
alert('Enter Text'+"#allowData").val());
return true
}
else {
alert('Please enter valid data')
return false;
}
})
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="allowData" runat="server"></asp:TextBox>
<asp:Button ID="doValidate" runat="server" Text="Validate" OnClick="doValidate_Click" />
</form>
</body>
</html>


Bel