Search this blog

Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Friday, July 10, 2009

Provide a Hyperlink to open in new window in SSRS Report

In SQL Server Reporting Services (SSRS) Report, we can provide Hyperlink field for a report field by following steps,

  • Right Click on the Report Field à Select "Property"

  • Go To "Navigation" Tab from Property window

  • In "Hyperlink action" section à select "Jump to URL" option

  • Enter the URL, For Example http://blog-mstechnology.blogspot.com/

  • Click on "Ok" to apply.

  • Now see the Report output thru Preview Tab in Report Designer.

  • Format the Report Field with fore color and underline (Ctrl + U), if not looks like Hyperlink.
This is general way to provide a hyperlink in SSRS. If you access this link on runtime, it always opens in same window. If you want to open in new window, then you can implement this thru JavaScript as given below

Place the following code on "Jump to URL" section.

="javascript:void(window.open('
http://blog-mstechnology.blogspot.com/','_blank'))"

Then it will open in new window. Hope it helps you.

Wednesday, June 24, 2009

JavaScript - Regular Expressions for Validate 24 Hrs Time

One of my friend requested me a code of Javascript to validate the time, which is in the format of 00:00 (24 hrs). i written this code. it may useful to someone, so that i posted in this blog

function Validate24Hrs(Time_Field) {

RegEx = "\([0-2][0-9]):([0-5][0-9])$";

Err_Msg = "";

if (Time_Field.value != "")

{

if (Regs = Time_Field.value.match(RegEx)) {

if ((Regs[1] > 23)) {

Err_Msg = 'Not Matching';

}

}

else {

Err_Msg = 'Not Matching';

}

}

if (Err_Msg != "") {

alert(Err_Msg);

Time_Field.focus();

return false;

}

else {

alert('Matching');

return true;

}

}


if it is useful or face any problem, please leave ur valuable comments here.

Have a Great Day!

Tuesday, June 9, 2009

Call Parent Page Method from Child Page thru ASP.NET, C#

The following codesnippet helps to call parent Page Javascript method from Child Page’s Code behind.

As per this code, I have a method "ParentMethod1()" in Parent page.

using System.Text;

StringBuilder sbScript = new StringBuilder();

sbScript.Append("<script language='javascript'>");

sbScript.Append(Environment.NewLine);

sbScript.Append("window.parent.ParentMethod1())");

sbScript.Append(Environment.NewLine);

sbScript.Append("</script>");

ClientScript.RegisterStartupScript(this.GetType(), "CloseWindow", sbScript.ToString());

Monday, June 8, 2009

How to Find out the Version of IE using JavaScript?

This Java function helps to Findout the Version IE Installed in your system
function getIEVersionNumber()
{
var ua = navigator.userAgent;
var MSIEOffset = ua.indexOf("MSIE ");

if (MSIEOffset == -1)

{
return 0;
}

else {
return parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)));
}
}