Month_Between function in oracle is used for calculating Year, Month & Days

select    trunc (months_between (end_date, start_date) / 12)
|| ‘ Years ‘ 

       || mod (trunc (months_between (end_date, start_date)), 12)
       || ‘ Months ‘
       || (  to_date (end_date)
           – add_months (start_date,
                         trunc (months_between (end_date, start_date))
                        )
          )
       || ‘ Days’
  from dual;
Advertisements

In ConfirmButtonExtender, We can use   character code to break line & put remaining character in new line.

Example :

<cc1:ConfirmButtonExtender ID=”cbeDelete” runat=”server” ConfirmText=“Before submitting your Application, Verify all filled details in the application. If you want to Submit your Application, Click on OK button.”
TargetControlID=”btnsubmit”>

 

If you like this post, pls leave your valuable comment.

Method : 1 (Using CSS)

<style>
tr:nth-child(even)
{
background: #E3F3FB;
color:Black;
}
tr:nth-child(odd)
{
background: #FFF;
color:Black;
}

tr:hover
{
background: #FFFFCB;
cursor: hand;
font-weight:bold;
color:Black;
cursor:pointer;
}
</style>

 

<table width=”100%” cellspacing=”0″ cellpadding=”0″ style=”border: none; border-collapse: collapse;”
border=”0″ id=”tbl”>
<tr style=”background-color: #294E79; color: White; text-align: center”>
<td style=”border: none; font-family: Arial” width=”5%”>
Sr No.
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
Heading1
</td>
<td style=”border: none; font-family: Arial” width=”10%”>
Heading2
</td>
<td style=”border: none; font-family: Arial” width=”10%”>
&nbsp;
</td>
</tr>
<tr>
<td style=”border: none; font-family: Arial; text-align: center” width=”5%”>
1
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
<asp:label runat=”server” id=”lbl1″ text=”TEXT2″></asp:label>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
<a href=”pdf file link” target=”_blank”>
<img src=”images/pdf.png” width=”20px” height=”20px” /></a>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
</td>
</tr>
<tr>
<td style=”border: none; font-family: Arial; text-align: center” width=”5%”>
2
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
<asp:label runat=”server” id=”Label1″ text=”TEXT2″></asp:label>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
<a href=”pdf file link” target=”_blank”>
<img src=”images/pdf.png” width=”20px” height=”20px” /></a>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
</td>
</tr>
</table>

 

Method : 2 (Using Jquery & CSS)

 

$(document).ready(function () {
$(‘#tbl tr:has(td)’).mouseover(function () {
$(this).addClass(“initial”);
});
$(‘#tbl tr’).mouseout(function () {
$(this).removeClass(“highlight”);
})
})

<style>
.initial
{
background-color: red;
color: #000000;
}
.normal
{
background-color: #CCCCCC;
}
.highlight
{
background-color: #8888FF;
}
</style>

<table width=”100%” cellspacing=”0″ cellpadding=”0″ style=”border: none; border-collapse: collapse;”
border=”0″ id=”tbl”>
<tr style=”background-color: #294E79; color: White; text-align: center”>
<td style=”border: none; font-family: Arial” width=”5%”>
Sr No.
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
Heading1
</td>
<td style=”border: none; font-family: Arial” width=”10%”>
Heading2
</td>
<td style=”border: none; font-family: Arial” width=”10%”>
&nbsp;
</td>
</tr>
<tr>
<td style=”border: none; font-family: Arial; text-align: center” width=”5%”>
1
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
<asp:label runat=”server” id=”lbl1″ text=”TEXT2″></asp:label>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
<a href=”pdf file link” target=”_blank”>
<img src=”images/pdf.png” width=”20px” height=”20px” /></a>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
</td>
</tr>
<tr>
<td style=”border: none; font-family: Arial; text-align: center” width=”5%”>
2
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
<asp:label runat=”server” id=”Label1″ text=”TEXT2″></asp:label>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
<a href=”pdf file link” target=”_blank”>
<img src=”images/pdf.png” width=”20px” height=”20px” /></a>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
</td>
</tr>
</table>

If you want to apply condition base formatting in crystal report, you can use below method for that.

if (IsNumeric({Student.Marks})) Then
if({Student.Marks} >= 40) then
crbold   //font bold – PASS
else
crregular //font regular – FAIL
else
crregular //if non-numeric/empty/NULL make the font regular – FAIL
=============================================================
To change the font style dynamically according to value, use this expression in your expression

=Format(First(Fields!Field_value.Value, “ABCDEFG”),”BOLD”)

Solution : 1

TemplateField with Hyperlink and img Element

<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink runat=”server” NavigateUrl='<%# Eval(“PAGE_Or_PDF_URL”) %>’
Target=”_blank”>
<img src='<%# Eval(“Image_URL”) %>’ alt=”PDF IMAGE” />
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>

Solution : 2
TemplateField with ImageButton

<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton runat=”server” ImageUrl='<%# Eval(“Image_URL”) %>’
PostBackUrl='<%# Eval(“Target_URL”) %>’ AlternateText=”Alternate Text” />
</ItemTemplate>
</asp:TemplateField>
Solution : 3

TemplateField with Javascript
<asp:TemplateField>

<asp:ImageButton ID=”ImageButton1″ runat=”server” ImageUrl='<%# Eval(“Image_URL”) %>’ OnClientClick='<%# String.Format (“javascript:return openTargetURL(\”{0}\”)”, Eval(“Target_URL”)) %>’ AlternateText=”Alternate Text” />

</asp:TemplateField>

For VB.NET
For Each vValidator As BaseValidator In Page.Validators
vValidator.Enabled = False
Next
For C#
foreach (BaseValidator vValidator in Page.Validators)
{
vValidator.Enabled = false;
}

Solution : 1

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add(“onmouseover”, “this.originalcolor=this.style.backgroundColor;” + ” this.style.backgroundColor=’#0090CB’; this.style.color = ‘white'”);
e.Row.Attributes.Add(“onmouseout”, “this.style.backgroundColor=this.originalcolor; this.style.color = ‘black'”);
}
}

Solution : 2

#GridView1 tr.rowHover:hover
{
background-color: Yellow;
font-family: Arial;
font-size:12px;
}

<asp:gridview id=”GridView1″ runat=”server” enableviewstate=”false” rowstyle-cssclass=”rowHover” clientidmode=”Static” />