<?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-3608615663994805410</id><updated>2011-07-30T15:50:34.332-07:00</updated><category term='Reporting'/><category term='custom function code'/><category term='Report'/><category term='sqlreporting'/><category term='SSRS Reporting Report Rotate Text custom function code'/><category term='Rotate Text'/><category term='text to image'/><category term='SSRS'/><title type='text'>Tejas Patel's BI Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tejasp.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tejasp.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Tejas</name><uri>http://www.blogger.com/profile/11396890566195591348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></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-3608615663994805410.post-236814353348196643</id><published>2010-05-07T05:55:00.000-07:00</published><updated>2010-05-07T05:58:28.279-07:00</updated><title type='text'>Use OF AMO</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3608615663994805410-236814353348196643?l=tejasp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tejasp.blogspot.com/feeds/236814353348196643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tejasp.blogspot.com/2010/05/use-of-amo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default/236814353348196643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default/236814353348196643'/><link rel='alternate' type='text/html' href='http://tejasp.blogspot.com/2010/05/use-of-amo.html' title='Use OF AMO'/><author><name>Tejas</name><uri>http://www.blogger.com/profile/11396890566195591348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608615663994805410.post-5305725451054961692</id><published>2009-12-27T06:27:00.000-08:00</published><updated>2010-05-07T06:04:25.455-07:00</updated><title type='text'>Measures Calibration System</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3608615663994805410-5305725451054961692?l=tejasp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tejasp.blogspot.com/feeds/5305725451054961692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tejasp.blogspot.com/2009/07/measures-calibration-system.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default/5305725451054961692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default/5305725451054961692'/><link rel='alternate' type='text/html' href='http://tejasp.blogspot.com/2009/07/measures-calibration-system.html' title='Measures Calibration System'/><author><name>Tejas</name><uri>http://www.blogger.com/profile/11396890566195591348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608615663994805410.post-8595864598325361956</id><published>2009-05-30T21:30:00.000-07:00</published><updated>2009-05-30T21:31:07.337-07:00</updated><title type='text'>create custom datamining controls</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3608615663994805410-8595864598325361956?l=tejasp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tejasp.blogspot.com/feeds/8595864598325361956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tejasp.blogspot.com/2009/05/create-custom-datamining-controls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default/8595864598325361956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default/8595864598325361956'/><link rel='alternate' type='text/html' href='http://tejasp.blogspot.com/2009/05/create-custom-datamining-controls.html' title='create custom datamining controls'/><author><name>Tejas</name><uri>http://www.blogger.com/profile/11396890566195591348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608615663994805410.post-8269828364674550975</id><published>2009-03-31T19:32:00.000-07:00</published><updated>2009-03-31T19:33:39.695-07:00</updated><title type='text'>How to write MDX or DMX stored procedures</title><content type='html'>HEre is an example..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3608615663994805410-8269828364674550975?l=tejasp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tejasp.blogspot.com/feeds/8269828364674550975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tejasp.blogspot.com/2009/03/how-to-write-mdx-or-dmx-stored.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default/8269828364674550975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default/8269828364674550975'/><link rel='alternate' type='text/html' href='http://tejasp.blogspot.com/2009/03/how-to-write-mdx-or-dmx-stored.html' title='How to write MDX or DMX stored procedures'/><author><name>Tejas</name><uri>http://www.blogger.com/profile/11396890566195591348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608615663994805410.post-6549468055112529592</id><published>2009-01-08T10:15:00.000-08:00</published><updated>2009-02-01T18:46:49.985-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSRS Reporting Report Rotate Text custom function code'/><category scheme='http://www.blogger.com/atom/ns#' term='Reporting'/><category scheme='http://www.blogger.com/atom/ns#' term='Report'/><category scheme='http://www.blogger.com/atom/ns#' term='text to image'/><category scheme='http://www.blogger.com/atom/ns#' term='custom function code'/><category scheme='http://www.blogger.com/atom/ns#' term='Rotate Text'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><category scheme='http://www.blogger.com/atom/ns#' term='sqlreporting'/><title type='text'>SSRS Reports Rotate Text Or Split Alphabet Per Line</title><content type='html'>Few days ago my client requested a report, which required rotation of text and alphabet by 45 degree. Expected output was something Like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_QlMfgXZwQYo/SYZM1pqre7I/AAAAAAAAAAs/pNt1aHVKvu8/s1600-h/45.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5298006496249609138" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 81px; CURSOR: hand; HEIGHT: 86px" alt="" src="http://2.bp.blogspot.com/_QlMfgXZwQYo/SYZM1pqre7I/AAAAAAAAAAs/pNt1aHVKvu8/s320/45.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Many of you may know that you can rotate a text in textbox by setting WritingMode to "tb-rl", which will rotate the text and it will look something like this:&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_QlMfgXZwQYo/SWZDE8Vo0dI/AAAAAAAAAAk/9GH7tWA236o/s1600-h/NameWrong.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5288988564588646866" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 62px; CURSOR: hand; HEIGHT: 187px" alt="" src="http://4.bp.blogspot.com/_QlMfgXZwQYo/SWZDE8Vo0dI/AAAAAAAAAAk/9GH7tWA236o/s320/NameWrong.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_QlMfgXZwQYo/SWZDE8Vo0dI/AAAAAAAAAAk/9GH7tWA236o/s1600-h/NameWrong.bmp"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In order to rotate text at desired angle do following:&lt;br /&gt;(1) create an image with desired text&lt;br /&gt;(2) rotate that image&lt;br /&gt;(3) import it to the image box in report&lt;br /&gt;&lt;br /&gt;Add System.Drawing to the references by going to the Report Properties -&gt; References.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;for step1 use following function:&lt;/strong&gt;&lt;br /&gt;Function CreateImage(ByVal sImageText As String, ByVal FontType As String, ByVal FontSize As Integer) As System.Drawing.Bitmap&lt;br /&gt;'Create an image from scratch&lt;br /&gt;Dim bmpImage As New Drawing.Bitmap(1, 1)&lt;br /&gt;Dim iWidth As Integer = 0&lt;br /&gt;Dim iHeight As Integer = 0&lt;br /&gt;'Create the Font object for the image text drawing.&lt;br /&gt;Dim MyFont As New Drawing.Font(FontType, FontSize, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point)&lt;br /&gt;'Create a graphics object to measure the text's width and height.&lt;br /&gt;Dim MyGraphics As Drawing.Graphics = Drawing.Graphics.FromImage(bmpImage)&lt;br /&gt;'This is where the bitmap size is determined.&lt;br /&gt;iWidth = MyGraphics.MeasureString(sImageText, MyFont).Width&lt;br /&gt;iHeight = MyGraphics.MeasureString(sImageText, MyFont).Height&lt;br /&gt;'// Create the bmpImage again with the correct size for the text and font.&lt;br /&gt;bmpImage = New Drawing.Bitmap(bmpImage, New Drawing.Size(iWidth, iHeight))&lt;br /&gt;'// Add the colors to the new bitmap.&lt;br /&gt;MyGraphics = Drawing.Graphics.FromImage(bmpImage)&lt;br /&gt;MyGraphics.Clear(Drawing.Color.White)&lt;br /&gt;MyGraphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias&lt;br /&gt;MyGraphics.DrawString(sImageText, MyFont, New Drawing.SolidBrush(Drawing.Color.Black), 0, 0)&lt;br /&gt;MyGraphics.Flush()&lt;br /&gt;Return bmpImage&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;for step2 use following function:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Function RotateImage(ByVal bm_in As System.Drawing.Bitmap, ByVal RotationAngle As Integer) As System.Drawing.Bitmap&lt;br /&gt;Dim wid As Single = bm_in.Width&lt;br /&gt;Dim hgt As Single = bm_in.Height&lt;br /&gt;Dim corners As System.Drawing.Point() = { _&lt;br /&gt;New System.Drawing.Point(0, 0), _&lt;br /&gt;New System.Drawing.Point(wid, 0), _&lt;br /&gt;New System.Drawing.Point(0, hgt), _&lt;br /&gt;New System.Drawing.Point(wid, hgt)}&lt;br /&gt;' Translate to center the bounding box at the origin.&lt;br /&gt;Dim cx As Single = wid / 2&lt;br /&gt;Dim cy As Single = hgt / 2&lt;br /&gt;Dim i As Long&lt;br /&gt;For i = 0 To 3&lt;br /&gt;corners(i).X -= cx&lt;br /&gt;corners(i).Y -= cy&lt;br /&gt;Next i&lt;br /&gt;' Rotate.&lt;br /&gt;Dim theta As Single = Single.Parse(RotationAngle) * System.Math.PI _&lt;br /&gt;/ 180.0&lt;br /&gt;Dim sin_theta As Single = System.Math.Sin(theta)&lt;br /&gt;Dim cos_theta As Single = System.Math.Cos(theta)&lt;br /&gt;Dim X As Single&lt;br /&gt;Dim Y As Single&lt;br /&gt;For i = 0 To 3&lt;br /&gt;X = corners(i).X&lt;br /&gt;Y = corners(i).Y&lt;br /&gt;corners(i).X = X * cos_theta + Y * sin_theta&lt;br /&gt;corners(i).Y = -X * sin_theta + Y * cos_theta&lt;br /&gt;Next i&lt;br /&gt;' Translate so X &gt;= 0 and Y &gt;=0 for all corners.&lt;br /&gt;Dim xmin As Single = corners(0).X&lt;br /&gt;Dim ymin As Single = corners(0).Y&lt;br /&gt;For i = 1 To 3&lt;br /&gt;If xmin &gt; corners(i).X Then xmin = corners(i).X&lt;br /&gt;If ymin &gt; corners(i).Y Then ymin = corners(i).Y&lt;br /&gt;Next i&lt;br /&gt;For i = 0 To 3&lt;br /&gt;corners(i).X -= xmin&lt;br /&gt;corners(i).Y -= ymin&lt;br /&gt;Next i&lt;br /&gt;' Create an output Bitmap and Graphics object.&lt;br /&gt;Dim bm_out As New System.Drawing.Bitmap(CInt(-2 * xmin), CInt(-2 * _&lt;br /&gt;ymin))&lt;br /&gt;Dim gr_out As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(bm_out)&lt;br /&gt;' Drop the last corner lest we confuse DrawImage,&lt;br /&gt;' which expects an array of three corners.&lt;br /&gt;ReDim Preserve corners(2)&lt;br /&gt;' Draw the result onto the output Bitmap.&lt;br /&gt;gr_out.Clear(Drawing.Color.White)&lt;br /&gt;gr_out.DrawImage(bm_in, corners)&lt;br /&gt;gr_out.Flush()&lt;br /&gt;' Display the result.&lt;br /&gt;Return bm_out&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;for step3 use following function:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Function StreamImage(ByVal bmpImage As System.Drawing.Bitmap)&lt;br /&gt;Dim stream As IO.MemoryStream = New IO.MemoryStream&lt;br /&gt;Dim bitmapBytes As Byte()&lt;br /&gt;'Create bitmap stream&lt;br /&gt;bmpImage.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg)&lt;br /&gt;bitmapBytes = stream.ToArray&lt;br /&gt;stream.Close()&lt;br /&gt;bmpImage.Dispose()&lt;br /&gt;Return bitmapBytes&lt;br /&gt;End Function&lt;br /&gt;Finally execute all together:&lt;br /&gt;Use following code:&lt;br /&gt;Function Create_RotateAndStreamImage(ByVal sImageText As String, ByVal FontType As String, ByVal FontSize As Integer, ByVal RotationAngle As Integer)&lt;br /&gt;'Create a blank image&lt;br /&gt;Dim bmpImage As New Drawing.Bitmap(1, 1)&lt;br /&gt;'Create an image from scratch&lt;br /&gt;bmpImage = CreateImage(sImageText, FontType, FontSize)&lt;br /&gt;'Rotate Image at desired Angle&lt;br /&gt;bmpImage = RotateImage(bmpImage, RotationAngle)&lt;br /&gt;Return StreamImage(bmpImage)&lt;br /&gt;Return bmpImage&lt;br /&gt;End Function&lt;br /&gt;It gives desired results&lt;br /&gt;buy using following expression:&lt;br /&gt;&lt;br /&gt;= Code.Create_RotateAndStreamImage("TEJAS", "Microsoft Sans Serif", 14, 45)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Incase some of you may want to get following outcome:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_QlMfgXZwQYo/SYZPg3yeT8I/AAAAAAAAAA8/2mzmMq_nz8U/s1600-h/90Up.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5298009437798027202" style="WIDTH: 62px; CURSOR: hand; HEIGHT: 215px" alt="" src="http://2.bp.blogspot.com/_QlMfgXZwQYo/SYZPg3yeT8I/AAAAAAAAAA8/2mzmMq_nz8U/s320/90Up.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, now you have to rotate the alphabets, there isn't a builtin function available to rotate alphabets.&lt;br /&gt;Anohter way is do not rotate text, just split word in to aphabet per line. You can use "&amp;amp; vbCrLf &amp;amp; " in between two alphabet to go to next line.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;I used following vb code to do that: &lt;/strong&gt;&lt;br /&gt;Public Function Split(Word As String) As String&lt;br /&gt;Dim TempWord As String&lt;br /&gt;Dim SplitTemp As String&lt;br /&gt;Split = ""&lt;br /&gt;TempWord = Word&lt;br /&gt;Do While Len(TempWord) &gt; 0&lt;br /&gt;SplitTemp = Left(TempWord, 1)&lt;br /&gt;Split = Split &amp;amp; vbCrLf &amp;amp; SplitTemp&lt;br /&gt;TempWord = Right(TempWord, Len(TempWord) - 1)&lt;br /&gt;Loop&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;And use following expression:&lt;br /&gt;&lt;br /&gt;=Code.Split("TEJAS")&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3608615663994805410-6549468055112529592?l=tejasp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tejasp.blogspot.com/feeds/6549468055112529592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tejasp.blogspot.com/2009/01/ssrs-reports-rotate-text-or-split.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default/6549468055112529592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608615663994805410/posts/default/6549468055112529592'/><link rel='alternate' type='text/html' href='http://tejasp.blogspot.com/2009/01/ssrs-reports-rotate-text-or-split.html' title='SSRS Reports Rotate Text Or Split Alphabet Per Line'/><author><name>Tejas</name><uri>http://www.blogger.com/profile/11396890566195591348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_QlMfgXZwQYo/SYZM1pqre7I/AAAAAAAAAAs/pNt1aHVKvu8/s72-c/45.bmp' height='72' width='72'/><thr:total>6</thr:total></entry></feed>
