Friday 30 November 2012

check box in SSRS

Senario:

based on the two optional set or optional set values we need to show
check boxes in the SSRS.

for this Refer :
http://kkryczka.wordpress.com/2010/12/09/how-to-display-checkbox-on-report/

http://www.mindfiresolutions.com/Including-Checkbox-in-SQL-Server-Reporting-1163.php

http://blog.hoegaerden.be/2012/08/04/displaying-checkboxes-in-an-ssrs-report/

First create a  report.
in that select the two optional set

Ex : Stock Available or Stock Not Available.

change the Font to "wingdings".
then go to the expression:

=iif(First(Fields!new_stockavilability.Value, "DataSet1")= false,chr(0254),chr(0168))

if it is the Optional set:

=iif(First(Fields!new_regionof.Value, "DataSet1")=100000002,chr(0254),chr(0168))

then you will get the check boxes in report.

Tuesday 20 November 2012

Check box Onclick Event in crm 2011


Senario:

we are using the checkboxes in crm 2011.
doing some customizations based on the checkboxes.
but the problem is :
After clicking on the checkbox, you need to click outside the box then only function will execute.

for overcome this problem:

just we need to give the one extra function in onload event.

ex ;
my check box field is : new_stockdelivered

then the function in onload event is :


function onload()
{
crmForm.all.new_stockdelivered.onclick = function()
{
    crmForm.all.new_stockdelivered.FireOnChange();
}
}

for suppose :
i have two fields :
new_stockdelivered and new_stockdelivereddate.
if you check on stock delivered then only date will be enable.

first give the onchange function :


function stockdate()
{
var myAttribute = "new_stockdelivered";
var myControl = Xrm.Page.ui.controls.get(myAttribute);
var detailamt= myControl.getAttribute().getValue();
if(detailamt==true)
{
Xrm.Page.getControl("new_stockdelivereddate").setDisabled(false);
}
else
{
Xrm.Page.getControl("new_stockdelivereddate").setDisabled(true);
}
}

it is in onchange event and onload event.

and extra in onload event :


function onload()
{
crmForm.all.new_stockdelivered.onclick = function()
{
    crmForm.all.new_stockdelivered.FireOnChange();
}
}

it will give immediate effect after click on the checkbox




Tuesday 6 November 2012

using HTML Web resource in crm 2011

First create a HTML code.
senario:
giving colours in form:

HTML code:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Test Page </title>
    <script type="text/javascript">
        var Xrm;
        if (window.opener) { Xrm = window.opener.Xrm; }
        else if (window.parent) { Xrm = window.parent.Xrm; }

        onload = function () {
            var myOptionSet = Xrm.Page.data.entity.attributes.get("new_flag");
            // var optionSetValue = myOptionSet.getValue();
            var optionSetText = myOptionSet.getText();
            document.bgColor = optionSetText;
            //alert(optionSetValue + " " + optionSetText);
        }
</script>
</head>
<body>
</body>
</html>

Create Web resource:
paste the code in Source place:



just add like web resource in the form

u will get like:



another example:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>trying</title>
 
    <script id = "demo" type="text/javascript">
        var Xrm;
        if (window.opener) {
            Xrm = window.opener.Xrm;
        }
        else if (window.parent) {
        Xrm = window.parent.Xrm;
    }
    onload = function () {
        debugger;
        var myname = Xrm.Page.data.entity.attributes.get("new_name").getValue();
        var mytest = Xrm.Page.data.entity.attributes.get("new_test").getValue();
        document.write(myname);
        document.write(mytest);
           }
   
    </script>
</head>
<body>
</body>
</html>



onload = function () {
        debugger;
        var myname = Xrm.Page.data.entity.attributes.get("new_name").getValue();
        var mytest = Xrm.Page.data.entity.attributes.get("new_test").getValue();
        var table = "<table border='1'><tr><td> Name </td> <td> Test </td> </tr><tr><td>" + myname + "</td><td>" + mytest + "</td></tr></table>";
        document.write(table);
        //document.write(mytest);


    }

some links for crm 2011