Hi All,

I am facing one problem as per client requirement copy the Datagrid
data and while paste in outlook/lotus notes email body the same table
formatted grid should be displayed.so for that i converted datagrid as
html string and when  i am pasting  in email body the data displayed
as  same  html string not table formatted data .please see the below
code and send me if you have any solution regarding this

Regards,
Rajasekhar

     public  function
copyEmailFriendlyView(event:ContextMenuEvent):void
     {
       var htmlStr:String = convertToHtmlText(dg);
       System.setClipboard(htmlStr);
       htmlStr ="";
     }

 public function convertToHtmlText(dg):Strin{
                         //<html><body>
                         //</body></html>
        var font = dg.getStyle('fontFamily');
        var size = dg.getStyle('fontSize');
        var str:String = '<table border="'+1+'" width="'+dg.width
+'">';
        str +=' <head> <meta http-equiv="Content-Type" content="text/
html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft
FrontPage 4.0"> <meta name="ProgId"
content="FrontPage.Editor.Document"> </head>';
        var colors = dg.getStyle("alternatingRowColors");
        for(var j=0;j<dg.dataProvider.length;j++)
        {
                           str += "<tr>"
                    var style = 'style="font-family:'+font+';font-
size:'+size+'pt;"';
                    if(ArrayCollection(dg.dataProvider).getItemAt(j) !
= undefined && ArrayCollection(dg.dataProvider).getItemAt(j) != null )
                    {
                    str += "<td  width=
\""+Math.ceil(dg.columns[0].width)+"\" "+style
+">"+ArrayCollection(dg.dataProvider).getItemAt(j)
[dg.columns[0].dataField]+"</td>";
                    str += "<td  width=
\""+Math.ceil(dg.columns[1].width)+"\" "+style
+">"+ArrayCollection(dg.dataProvider).getItemAt(j)
[dg.columns[1].dataField]+"</td>";
                    }
                str += "</tr>";
        }
        str+="</table>";
        return str;
}

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to