Report Text Mirror or Rotate

stony
Member Posts: 122
Hallo,
is it possible to rotate 180 degrees a text in RDLC.
thanks
stony
is it possible to rotate 180 degrees a text in RDLC.
thanks
stony
0
Comments
-
Hi,
You can rotate the text this director ("Horizontal","Vertical","Rotate270") by using "WritingMode" property of TextBox. Set Text Box Orientation (Report Builder and SSRS)https://msdn.microsoft.com/en-us/ee633659.aspx. In order to get your requirement you need to draw image at your report instead of using standard.
Here is Draw the String Image base on your requirement (Mirror)Function DrawText(ByVal sImageText As String, ByVal sFont As String, ByVal iFontSize As Integer, ByVal iFontStyle As Integer) sImageText = sImageText.PadRight(40) Dim bmpImage As New Drawing.Bitmap(1, 1) Dim iWidth As Integer = 0 Dim iHeight As Integer = 0 '// Create the Font object for the image text drawing. Dim MyFont As New Drawing.Font(sFont, iFontSize, iFontStyle, System.Drawing.GraphicsUnit.Point) '// Create a graphics object to measure the text's width and height. 'Graphics(MyGraphics = Graphics.FromImage(bmpImage)) Dim MyGraphics As Drawing.Graphics = Drawing.Graphics.FromImage(bmpImage) '// This is where the bitmap size is determined. iWidth = MyGraphics.MeasureString(sImageText, MyFont).Width iHeight = MyGraphics.MeasureString(sImageText, MyFont).Height '// Create the bmpImage again with the correct size for the text and font. 'Make Horizontal bmpImage = New Drawing.Bitmap(bmpImage, New Drawing.Size(iWidth, iHeight)) ''Make Vertical 'bmpImage = New Drawing.Bitmap(bmpImage, New Drawing.Size(iHeight, iWidth)) '// Add the colors to the new bitmap. MyGraphics = Drawing.Graphics.FromImage(bmpImage) MyGraphics.Clear(Drawing.Color.White) MyGraphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias ''Here is original code 'MyGraphics.TranslateTransform(0, iWidth) 'MyGraphics.RotateTransform(270) MyGraphics.DrawString(sImageText, MyFont, New Drawing.SolidBrush(Drawing.Color.Black), 0, 0) MyGraphics.Flush() Dim stream As IO.MemoryStream = New IO.MemoryStream Dim bitmapBytes As Byte() 'Create bitmap 'Rotating the image 'RotateFlipType.RotateNoneFlipY = 6 bmpImage.RotateFlip(6) bmpImage.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg) bitmapBytes = stream.ToArray stream.Close() bmpImage.Dispose() Return bitmapBytes End Function
1. Copy above function and past it at your report custom code.
2. Add (System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) assemblies at report references.
3. Add image to your report.
4. Use below code at your Image's Value properties. And Image Source must be "Database".''DrawText(YourText,FontName,FontSize,FontStyle) =code.DrawText("Hello World","Arial",10,0)
You will be see below sample after you work above step.
Here is original link http://www.sqljason.com/2011/01/rotate-text-in-ssrs.html to show vertical drawing for older SSRS version. Credit to "JASON THOMAS"
Regards,
YukonMake Simple & Easy0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions