<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2642841353890820486</id><updated>2011-12-02T12:38:09.089+05:30</updated><title type='text'>BSankaran</title><subtitle type='html'>An Absent Minded Lazy Human Being !!!!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bsankaran.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bsankaran.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Balaji</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_n0G6WaPyfF8/SeYGzvSFJfI/AAAAAAAABUw/oxmA3eqr9ck/S220/DSC02240.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2642841353890820486.post-5313223091583599466</id><published>2011-12-02T12:26:00.001+05:30</published><updated>2011-12-02T12:29:23.411+05:30</updated><title type='text'>Payables Aging View</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Hi All,&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Most of my customers have always asked this to be on excel, as the aging in GP does not produce it over in excel. A simple yet powerful script.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Regards,&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Bala&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="background-color: blue; font-size: xx-small;"&gt;If Exists(Select * From Sys.Objects Where Name = N'GSPayablesAging' And Type = 'V')&lt;br /&gt;Begin&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Drop View GSPayablesAging&lt;br /&gt;End&lt;br /&gt;Go&lt;br /&gt;Create View&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GSPayablesAging&lt;br /&gt;With&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Encryption&lt;br /&gt;As&lt;br /&gt;Select&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LTrim(RTrim(A.VendorId)) As VendorId,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull((Select IsNull(VendName,'IsBlank') From PM00200 Where VendorId = A.VendorId),'IsBlank') As VendName,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LTrim(RTrim(A.BchSourc)) As BchSourc,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull(A.DocDate,'01-Jan-1900') As DocDate,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull(A.DueDate,'01-Jan-1900') As DueDate,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull(A.DocType,0) As DocType,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 1 Then 'Invoice'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 2 Then 'Finance Charge'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 3 Then 'Miscellaneous Charge'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 4 Then 'Return'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then 'Credit Memo'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then 'Payment'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 'Un Known'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As DocTypNm,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LTrim(RTrim(A.VchrNmbr)) As VchrNmbr,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LTrim(RTrim(A.DocNumbr)) As DocNumbr,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.TrxDscrn As TrxDscrn,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.CurncyID As CurncyID,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull((Select IsNull(CurrnIdx,0) From Dynamics..MC40200 Where CurncyId = A.CurncyID),0) As CurrnIdx,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull((Select IsNull(FunlCurr,'IsBlank') From MC40000),'IsBlank') As FunlCurr,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull((Select IsNull(FunCrIdx,0) From MC40000),0) As FunCrIdx,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull(B.XchgRate,0) As XchgRate,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull(B.ExchDate,'01-Jan-1900') As ExchDate,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(A.DocAmnt) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(A.DocAmnt) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(A.DocAmnt)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As DocAmnt,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(IsNull(B.OrDocAmt,0)) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(IsNull(B.OrDocAmt,0)) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(IsNull(B.OrDocAmt,0))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As OrDocAmt,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(A.CurTrxAm)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As CurTrxAm,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(IsNull(B.OrCTrxAm,0)) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(IsNull(B.OrCTrxAm,0)) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(IsNull(B.OrCTrxAm,0))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As OrCTrxAm,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull(GetDate(),'01-Jan-1900') As 'Aging Date',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When IsNull(A.DueDate,'01-Jan-1900') &amp;gt; IsNull(GetDate(),'01-Jan-1900') Then IsNull(DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')),0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As 'Aging Days',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When (DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;lt; 0) Then &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(A.CurTrxAm)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As 'Not Yet Due',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When (DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;gt;= 0 And DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;lt;= 30) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(A.CurTrxAm)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As '0 - 30 Days',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When (DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;gt;= 31 And DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;lt;= 60) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(A.CurTrxAm)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As '31 - 60 Days',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When (DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;gt;= 61 And DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;lt;= 90) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(A.CurTrxAm)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As '61 - 90 Days',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When (DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;gt;= 91 And DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;lt;= 120) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(A.CurTrxAm)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As '91 - 120 Days',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When (DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;gt;= 121 And DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;lt;= 150) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(A.CurTrxAm)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As '121 - 150 Days',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When (DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;gt;= 151 And DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;lt;= 180) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(A.CurTrxAm)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As '151 - 180 Days',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When (DateDiff(dd,IsNull(A.DueDate,'01-Jan-1900'),IsNull(GetDate(),'01-Jan-1900')) &amp;gt;= 181) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Case A.DocType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 5 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; When 6 Then (Abs(A.CurTrxAm) * -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Abs(A.CurTrxAm)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End As '181 Days And Above'&lt;br /&gt;From&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PM20000 A&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Left Outer Join&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MC020103 B&lt;br /&gt;On&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (A.VchrNmbr = B.VchrNmbr And A.DocType = B.DocType)&lt;br /&gt;Where&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.Hold = 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; And&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.Voided = 0&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;Go&lt;br /&gt;Grant Select On GSPayablesAging To DynGrp&lt;br /&gt;--Select * From GSPayablesAging&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2642841353890820486-5313223091583599466?l=bsankaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bsankaran.blogspot.com/feeds/5313223091583599466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bsankaran.blogspot.com/2011/12/payables-aging-view.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default/5313223091583599466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default/5313223091583599466'/><link rel='alternate' type='text/html' href='http://bsankaran.blogspot.com/2011/12/payables-aging-view.html' title='Payables Aging View'/><author><name>Balaji</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_n0G6WaPyfF8/SeYGzvSFJfI/AAAAAAAABUw/oxmA3eqr9ck/S220/DSC02240.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2642841353890820486.post-583289435488281228</id><published>2011-08-12T12:15:00.002+05:30</published><updated>2011-08-20T00:40:11.028+05:30</updated><title type='text'>Analytical Accounting Analysis</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Hi All,&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Its been a while, since I had done a post. The current blog is all about using SQL Views to produce reports on Analytical Accounting module of Dynamics GP. All along AA has been a very powerful tool to track additional information on transactions affecting General Ledger. Having said that, as powerful as the module itself, AA lacks very much interms of reporting. The Multi Query report of AA is too complex that a normal customer would not have enough knowledge to generate the reports the way they want.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Having faced the same issue with a variety of customers, I developed this SQL view which would generate all the GL / AA information in one single query that can be used by the customers to generate custom reports.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://docs.google.com/leaf?id=0B2xJ4iF6YtdGODUzODA3NzEtNTE1ZC00ODRmLWFlMzItMThkODEzMzdmZDk5&amp;amp;hl=en_US"&gt;GSAADimensionAnalysis&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;NB : Check the version information, to get the latest file. &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2642841353890820486-583289435488281228?l=bsankaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bsankaran.blogspot.com/feeds/583289435488281228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bsankaran.blogspot.com/2011/08/analytical-accounting-analysis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default/583289435488281228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default/583289435488281228'/><link rel='alternate' type='text/html' href='http://bsankaran.blogspot.com/2011/08/analytical-accounting-analysis.html' title='Analytical Accounting Analysis'/><author><name>Balaji</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_n0G6WaPyfF8/SeYGzvSFJfI/AAAAAAAABUw/oxmA3eqr9ck/S220/DSC02240.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2642841353890820486.post-3141622113927928748</id><published>2011-03-05T00:01:00.000+05:30</published><updated>2011-03-05T00:01:38.639+05:30</updated><title type='text'>Dynamics GP - User Preferences</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Hi All,&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Its been a while, since I had made a blog. Well as my character is defined, I guess I am a bit too lazy to do come and blog. Trying to overcome this as I type this blog. Coming back to Blog, I have always been asked this question, by almost all my customers and hence the blog.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;The question is always like this. " I am comfortable using the Return Key (Enter Key) to shift between fields in my old ERP. In Dynamics GP, I have to use Tab Key.". This is confusing to me and makes my life difficult. Can you please help me ?".&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;My answer is always a Smile and a Big YES.&amp;nbsp; I am here by mentioning the steps that you need to do in order to make this changes. Login into Dynamics GP. Once logged into Dynamics GP, go to the Shortcuts tab on the Home Page. Click on the User Preferences option the Shortcuts. This would open up the User Preferences window within Dynamics GP. Right on the screen you would have an option called Entry Key. Select the option you want and Click on the OK button.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Bingo, you have made the changes.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Regards,&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Balaji&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh4.googleusercontent.com/-MpF20Wck0PA/TXEvqfStEiI/AAAAAAAABdA/obfTVqLHIx0/s1600/GSUserPreferences.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="245" src="https://lh4.googleusercontent.com/-MpF20Wck0PA/TXEvqfStEiI/AAAAAAAABdA/obfTVqLHIx0/s400/GSUserPreferences.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;NB : The picture attached with this blog explains the step by step approach.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2642841353890820486-3141622113927928748?l=bsankaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bsankaran.blogspot.com/feeds/3141622113927928748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bsankaran.blogspot.com/2011/03/dynamics-gp-user-preferences.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default/3141622113927928748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default/3141622113927928748'/><link rel='alternate' type='text/html' href='http://bsankaran.blogspot.com/2011/03/dynamics-gp-user-preferences.html' title='Dynamics GP - User Preferences'/><author><name>Balaji</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_n0G6WaPyfF8/SeYGzvSFJfI/AAAAAAAABUw/oxmA3eqr9ck/S220/DSC02240.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh4.googleusercontent.com/-MpF20Wck0PA/TXEvqfStEiI/AAAAAAAABdA/obfTVqLHIx0/s72-c/GSUserPreferences.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2642841353890820486.post-4564516530326620916</id><published>2010-02-11T23:54:00.000+05:30</published><updated>2010-02-11T23:54:20.496+05:30</updated><title type='text'>Dexterity Warning Message With Carriage Return</title><content type='html'>&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Hi All,&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Welcome back to another blog of mine. This time the Blog is on &lt;b&gt;Microsoft Dexterity For Dynamics GP&lt;/b&gt;. A very nee-sh market segment yet very famous within the domain of Small &amp;amp; Medium Business Applications. Throughout the application programming, we have come across various stages we would have to use Warning Messages. One of the easiest way to setup a warning message within Dexterity is to use the keyword &lt;b&gt;&lt;span style="color: blue;"&gt;warning &lt;/span&gt;&lt;/b&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;which would throw up a system based warning message. This can be pretty much compared with &lt;b style="color: blue;"&gt;Message Box&lt;/b&gt; function within .Net, with very limited features. The code to produce a simple warning message would be as follows&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_n0G6WaPyfF8/S3RGwAk5Z3I/AAAAAAAABao/2LVOcT3SjC8/s1600-h/Warning.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_n0G6WaPyfF8/S3RGwAk5Z3I/AAAAAAAABao/2LVOcT3SjC8/s320/Warning.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp;Normally when we use a warning statement, we would get a Model Dialog window with the message written on it. This would look as shown below.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_n0G6WaPyfF8/S3RGWd1mYII/AAAAAAAABag/yptHvnWCzlo/s1600-h/Hello+World.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="115" src="http://2.bp.blogspot.com/_n0G6WaPyfF8/S3RGWd1mYII/AAAAAAAABag/yptHvnWCzlo/s320/Hello+World.JPG" width="320" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt; &lt;span style="font-size: x-small;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;Looking at the picture one can be certain of the fact that the warning dialog produces a string based result. In order for us to incorporate Carriage Return based message we should first make sure that the message is text based message. A text based message can, within Dexterity can be simply produced by converting a string to text. This can be achieved by using the keyword &lt;b style="color: blue;"&gt;text&lt;/b&gt; before the actual message. The code for the same would look as follows.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/_n0G6WaPyfF8/S3RIAogp6dI/AAAAAAAABaw/W5svj__xlEs/s1600-h/Warning+1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_n0G6WaPyfF8/S3RIAogp6dI/AAAAAAAABaw/W5svj__xlEs/s320/Warning+1.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;Now while we debug this piece of code, we can see the difference in the way Dexterity handles the change in data type. The message box displayed by the above code would look as follows&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/_n0G6WaPyfF8/S3RIbC2kYbI/AAAAAAAABa4/kTfC8XTibqc/s1600-h/Hello+World+1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_n0G6WaPyfF8/S3RIbC2kYbI/AAAAAAAABa4/kTfC8XTibqc/s320/Hello+World+1.JPG" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;A close look at the code reveals the fact that a text data type is the only one which would have an ability to handle a Carriage Return within Dexterity. Now lets attempt to generate a Dexterity Based Warning Message using Carriage Return. The ASCII code for Carriage Return within Dexterity is char(13)&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_n0G6WaPyfF8/S3RJbKlCrVI/AAAAAAAABbA/ERoCD7Z45Ns/s1600-h/ASCII.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_n0G6WaPyfF8/S3RJbKlCrVI/AAAAAAAABbA/ERoCD7Z45Ns/s320/ASCII.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;We would use this code to change the code so that the resultant message is capable of handling Carriage Return. Now lets us attempt to change the original code so that we are able to handle Carriage Return.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/_n0G6WaPyfF8/S3RKJmjZFeI/AAAAAAAABbI/N5_v5BQtzks/s1600-h/Warning+2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_n0G6WaPyfF8/S3RKJmjZFeI/AAAAAAAABbI/N5_v5BQtzks/s320/Warning+2.JPG" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&amp;nbsp; &lt;span style="font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;We The above mentioned code is pretty much self explanatory. A local variable with data type text is being initialized with certain data which contains Carriage Return. When the system warning message is used with this local variable, the displayed warning message would look as follows&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/_n0G6WaPyfF8/S3RK2Js4VOI/AAAAAAAABbQ/5wBANKEZcYs/s1600-h/Hello+World+2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_n0G6WaPyfF8/S3RK2Js4VOI/AAAAAAAABbQ/5wBANKEZcYs/s320/Hello+World+2.JPG" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;Thus we have successfully created a Dexterity Based warning message with Carriage Return built into it. The same technique can be applied to bring about any other non - printable ASCII Codes within Dexterity, of course there are a few limitations.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2642841353890820486-4564516530326620916?l=bsankaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bsankaran.blogspot.com/feeds/4564516530326620916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bsankaran.blogspot.com/2010/02/dexterity-warning-message-with-carriage.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default/4564516530326620916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default/4564516530326620916'/><link rel='alternate' type='text/html' href='http://bsankaran.blogspot.com/2010/02/dexterity-warning-message-with-carriage.html' title='Dexterity Warning Message With Carriage Return'/><author><name>Balaji</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_n0G6WaPyfF8/SeYGzvSFJfI/AAAAAAAABUw/oxmA3eqr9ck/S220/DSC02240.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_n0G6WaPyfF8/S3RGwAk5Z3I/AAAAAAAABao/2LVOcT3SjC8/s72-c/Warning.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2642841353890820486.post-4415377512163641709</id><published>2009-11-02T23:20:00.002+05:30</published><updated>2009-11-03T10:40:36.144+05:30</updated><title type='text'>InterfacedCOMDll</title><content type='html'>&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Hi All,&lt;br /&gt;When I stepped into the .Net world, it was a random jump from the world of ERP Programming. Till that point in time, I was more into changing objects, which were created not sure by whom, but had some kind of GUI associated with it and a business purpose behind it. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Once into the .Net world, things started changing drastically infront of my eyes. Things which I never imagined possible started emerging from no where. Trust me!! It takes allmost 30 lines of code, in my legacy programming language, to strip a FilePath and get the file name and that too, with the limiation of providing the extension as an option. !!. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Wohoooooo, Thats what I would call &lt;strong&gt;.Net&lt;/strong&gt;. A very powerful collection of &lt;strong&gt;Object Oriented Environment&lt;/strong&gt; that allows a developer to choose&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: black; font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;strong&gt;What They Want&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: black; font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;strong&gt;How They Want&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: black; font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;strong&gt;Where They Want&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Thats .Net for you all. Now let us come back to the topic. Ever since I started .Net programming, as it has been with every other beginner, it was really tough to get help for the problem that I face. Searching in Google / MSDN is the best option. Even with that there is very little help that one can get until one becomes an expert in understanding the Help itself. So much is there on the world of .Net, that the help itself is too complex to understand. I think, I have this habit of going too much out of the topic !!!!...I think, I am nuts !!..&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Let's continue with the topic. We will take a look into the most basic function that one would do using .Net, which is creating a Dynamic Linked Library (*.dll). Lets understand a bit more about a DLL. The name DLL itself is self explanatory. It is a library of Dynamic Linked objects. The objects are called Dynamic because of the dynamic nature of the objects itself; which means that the component objects themselves are dynamic meaning, they exist only when required.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Lets go into a step by step example as to how to create a Dynamic Linked Library. The environment that I am using for this purpose is Visual Studio 2005 SP1. Having said that the same code would work moving forward and backward interms of environment variables. Now lets us see how to make a DLL and then expose the DLL to other COM Compatible applications.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;The first step in creating the DLL's is to create a Visual Studio(VS) project. We would open up our VS environment and select a new project. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5399452828094188242" src="http://2.bp.blogspot.com/_n0G6WaPyfF8/Su61vVgIStI/AAAAAAAABXU/JMdd2BCb5IU/s320/Fig00101.JPG" style="cursor: hand; display: block; height: 280px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;VS would now open up a Dialog window where as a developer one would be able to create umtine number of application starting right from a class all the way to a Website. As far as the current topic goes the plan is to create a DLL. So the choice automatically goes to a Windows Based Class(*.cs). Please refer the figure below as to how to setup the Project Properties.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5399455859635916114" src="http://4.bp.blogspot.com/_n0G6WaPyfF8/Su64fy4ADVI/AAAAAAAABXk/8TpVj52h8Fs/s320/Fig00103.JPG" style="cursor: hand; display: block; height: 217px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;The language preference is one the best features of .Net. It allows you to basically select the language of your choice. I am into C#, as far as development language is concerned. I will leave it upto you guys to decide which is the best language for you to go ahead. Once we setup the base of the project as per the above figure our next step would be go ahead and make the DLL itself. Now a few things that we need to take a look here before we make the launch. Ofcourse these are not very important, but would be a good addition for sure.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Upon clicking the OK Button on the above figure, VS would create and append all required references and base code for the DLL. You might have to wait for a while, ranging from a couple of seconds to a couple of minutes based on the system hardware that you have. System Hardware is my way of saying System Requirements. Please look into Microsoft website to figure out what is the system requirement to have VS 2005 SP1 running, of for that matter what ever is your development environment. Grrrr..I hate going out of topic...Man..I am seriously nuts !!!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Please note that the next&amp;nbsp;step is an optional step, as the system would anyway prefill all these information based on the VS setup itself. Just thought would share the way I do it. What I am doing here is that, I am going to show you how to setup the Assembly Information, as per your choice. For the current example, I am taking it as my Name itself (Balasubramonian Sankaran abbreviated as BSankaran&amp;nbsp;:D). To do this right click on the Solution Name as shown in the figure below. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_n0G6WaPyfF8/Su8RUZZTRwI/AAAAAAAABX0/ggj2nMyVuFI/s1600-h/Fig00106.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_n0G6WaPyfF8/Su8RUZZTRwI/AAAAAAAABX0/ggj2nMyVuFI/s320/Fig00106.JPG" vr="true" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_n0G6WaPyfF8/Su8RjCUmeoI/AAAAAAAABX8/HVLgNxjwxr4/s1600-h/Fig00107.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_n0G6WaPyfF8/Su8RjCUmeoI/AAAAAAAABX8/HVLgNxjwxr4/s320/Fig00107.JPG" vr="true" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Now click on the Assembly Information button as shown in the above figure(Right Side). The assembly information window would open up. Fill up this window as per the choice of yours (Mostly your organization would have some standard in creating the DLL's. Touch base with your seniors !!!!)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_n0G6WaPyfF8/Su8R_JH932I/AAAAAAAABYE/YcYi9aN28K4/s1600-h/Fig00108.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_n0G6WaPyfF8/Su8R_JH932I/AAAAAAAABYE/YcYi9aN28K4/s320/Fig00108.JPG" vr="true" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Ok. Lets make a come back to our original project itself. Once we setup the above mentioned information, now we are all set to get to creating the Assembly. Please note that the system by default creates a unique GUID for the assembly. This would be used by the Registration tool (RegAsm.exe) to register the DLL to the registry of the operating system. The next step is to start creating the Assembly itself. You would have noted that I have changed the word DLL to Assembly in the last couple of lines. DLL is the extension of the file where as the name of the file type is called Assembly. Hence this change. I am taking you into .Net world slowly but steadily.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Now lets us take a look at the solution itself. You would have found that the system would have created a file named &lt;strong&gt;Class1.cs&lt;/strong&gt; in the project. This is the main class for your project. Basically a class is a collection of various functions / procedures / attributes (You name it !!!). As far as the example goes, I am going to rename the class name to InterfacedCOMDll.cs. You can just right click on the Class1.cs and rename it just like how you rename any other file. This would automatically change the Assembly Information too (I have applied this change on the Assembly Information figure above).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Now the one of the most important step. On the top of the class, above the namespace tag you would notice that there are a couple of lines of code, which start with the word "&lt;strong&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;/strong&gt;".These are basically the references that we are adding to this class of ours. You have to add the reference called &lt;span style="color: blue;"&gt;&lt;strong&gt;System.Runtime.InteropServices&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;. This is the reference that would allow you to make the Assembly expose to an interface and use the interface to call the various elements within the class itself. I have also added a reference to the &lt;strong&gt;&lt;span style="color: blue;"&gt;System.IO&lt;/span&gt;&lt;/strong&gt; class. This basically allows us to do some logging activities as you would see later in the blog. Overall your class would now look somthing like as shown in figure below&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_n0G6WaPyfF8/Su8Ugf1klOI/AAAAAAAABYM/maEvTJRDzNA/s1600-h/Fig00109.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_n0G6WaPyfF8/Su8Ugf1klOI/AAAAAAAABYM/maEvTJRDzNA/s320/Fig00109.JPG" vr="true" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Now we are all set to create the Assembly. For the sake of this example, we are going to create a function that would write the System Information(Not all, but a few which I like plus the Stack) onto a log file. I have explained in the code what each line of code does. For simplicity, add the function within the class as shown in figure below&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_n0G6WaPyfF8/Su8WdNCf3VI/AAAAAAAABYU/h-AxHQjgcnc/s1600-h/Fig00110.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_n0G6WaPyfF8/Su8WdNCf3VI/AAAAAAAABYU/h-AxHQjgcnc/s640/Fig00110.JPG" vr="true" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Now overall our project looks good. Till now all that we have done is creation of a public method within the class. I am sure all of you would have done this. The next step is the most important of all. That is what the Blog is all about. How to make the Assembly Interfaced. We will add an interface to this class. What is an interface. As the name indicates, it is a means to reach the class when exposed to COM. The easiest way to create an interface is to just click inside the class. Right Click &amp;gt;&amp;gt; Refactor &amp;gt;&amp;gt; Extract Interface. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_n0G6WaPyfF8/Su8ZKWrZfaI/AAAAAAAABYk/feI16QRQCtA/s1600-h/Fig00104.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_n0G6WaPyfF8/Su8ZKWrZfaI/AAAAAAAABYk/feI16QRQCtA/s320/Fig00104.JPG" vr="true" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_n0G6WaPyfF8/Su8ZX6b7QpI/AAAAAAAABYs/_aJVSK2DOFU/s1600-h/Fig00105.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_n0G6WaPyfF8/Su8ZX6b7QpI/AAAAAAAABYs/_aJVSK2DOFU/s320/Fig00105.JPG" vr="true" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Or alternatively you could use the Project &amp;gt;&amp;gt; Add New Item &amp;gt;&amp;gt; Interface. The latter would require you to add the interface manually, where as the former would provide you a GUI based window where upon you would be able to make the selection. Voila !!! You have created the interface for the class. You will now notice that the an additional class file (*.cs) has appeared on your project plus the namespace has changed in your project file. This is because of the interface. You would need to manually remove any additional item from the namespace. The name space would ideally have to be &lt;strong&gt;ClassName : InterfaceName&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_n0G6WaPyfF8/Su8arG3pV3I/AAAAAAAABY0/AF9rrpZqGlw/s1600-h/Fig00112.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_n0G6WaPyfF8/Su8arG3pV3I/AAAAAAAABY0/AF9rrpZqGlw/s320/Fig00112.JPG" vr="true" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Now&amp;nbsp; last but not least. Remember the namespace and the class name. Above that add the following attributes that allows the class to be interfaced when used by a COM supportive application.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_n0G6WaPyfF8/Su8XsGJMuzI/AAAAAAAABYc/0D0hEUJRbI0/s1600-h/Fig00111.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_n0G6WaPyfF8/Su8XsGJMuzI/AAAAAAAABYc/0D0hEUJRbI0/s400/Fig00111.JPG" vr="true" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;To know what&amp;nbsp;the above mentioned properties does, please take a look at your COM Object Handbook or you can just ask your senior. I am planning to do another blog on that regard. Lets leave it as of now. What is more important is that you make these changes to your script. Please note that the ProgId can be set to any string. As a tribute to this blog, you can even put my name :). Now atleast you all will agree that I am really nuts !!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Coming back to the project. You have successfully interfaced the class that we created and now we are all set to initialize the class. Use the RegAsm.exe, which is part of your .Net Framework and register the DLL.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;Open the VS Command Promt or use the Normal Command Promt. In the case of the later, you would have to manually navigate to the .Net Framework directory. Use the below mentioned scripts to register &amp;amp; unregister the Assembly.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;Register&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; regasm "FullyQualifiedPath\AssemblyName.dll" \tlb&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Un Register&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; regasm \u "FullyQualifiedPath\AssemblyName.dll"&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Now that makes the DLL Interfaced and COM Compatible. You could use this DLL with any COM Compatible application and make use of the DLL itself. Wow I have completed my Blog !!!!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Feel free to comment on the blog. Your comments are most appreciated !!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Thanks &amp;amp; Best Regards&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Balaji&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;Source Code &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;Link&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.teradepot.com/lrkd773cypdz/InterfacedCOMDll.rar.html"&gt;http://www.teradepot.com/lrkd773cypdz/InterfacedCOMDll.rar.html&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;Password&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;balaji1983&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2642841353890820486-4415377512163641709?l=bsankaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bsankaran.blogspot.com/feeds/4415377512163641709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bsankaran.blogspot.com/2009/11/interfacedcomdll.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default/4415377512163641709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2642841353890820486/posts/default/4415377512163641709'/><link rel='alternate' type='text/html' href='http://bsankaran.blogspot.com/2009/11/interfacedcomdll.html' title='InterfacedCOMDll'/><author><name>Balaji</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_n0G6WaPyfF8/SeYGzvSFJfI/AAAAAAAABUw/oxmA3eqr9ck/S220/DSC02240.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_n0G6WaPyfF8/Su61vVgIStI/AAAAAAAABXU/JMdd2BCb5IU/s72-c/Fig00101.JPG' height='72' width='72'/><thr:total>3</thr:total></entry></feed>
