Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • HTML_BulletedList - Process text into a bulleted list using HTML syntax. To have the HTML rendered in the report, open Placeholder Properties for the Placeholder using this code and change Markup type to ‘HTML’. If the Header parameter is supplied it will look for a header in the text provided in the Value parameter for a header surrounded by double square brackets and will return only the text between that header and the next header found or the end of the text if a subsequent header is not found.
    HTML_BulletedList(Value as String, Delimiter as String, Optional Header as String) as String
    Example:

    • Text in Value Parameter

      Code Block
      [[Exclusions]]
      Applicable sales taxes
      All Electrical, Plumbing, HVAC
      [[Notes]]
      This Proposal becomes part of a contract document
      This proposal is valid for 30 days.
    • Function reference in Code

      Code Block
      CrowsNest.Reporting.String.HTML_BulletedList(Fields!LongDescription.Value, Environment.NewLine, “Exclusions”)
    • Result

      Code Block
      languagehtml
      <ul>
      <li>Applicable sales taxes</li>
      <li>All Electrical, Plumbing, HVAC</li>
      </ul>
  • JoinNonNull - Join an array of objects to a string with a delimiter, excluding any empty values.

    Code Block
    JoinNonNull(Values() as Object, Optional Delimeter as String = "") as String

Images

  • PadLeft - Calculate a Left Padding value to horizontally align a database image to center or right. To align right change CenterImage parameter to False.

    Code Block
    PadLeft(imgBytes As Byte(), cellWidth As Double, cellHeight As Double, Optional UnitOfMeasure As String = "in", Optional CenterImage As Boolean = True) As String
  • PadTop - Calculate a Top Padding value to vertically align a database image to center or bottom. To align bottom change CenterImage parameter to False.

    Code Block
    PadTop(imgBytes As Byte(), cellWidth As Double, cellHeight As Double, Optional UnitOfMeasure As String = "in", Optional CenterImage As Boolean = True) As String
  • ColorToHex - Get a hexadecimal color string from a String or a System.Drawing.Color

    Code Block
    ColorToHex(c as Drawing.Color) as String
    ColorToHex(s as String) as String
    • Example Expressions

      Code Block
      =Code.ColorToHex(Fields!BackColor.Value)
      =Code.ColorToHex("255,255,255")
  • StringToColor - Get a System.Drawing.Color from a color string

    Code Block
    StringToColor(strColor as String, Optional defaultColor as Object = Nothing) as System.Drawing.Color
  • QRCode - Generate a QRCode image as a byte array to display in an Image object.

    Code Block
    QRCode(content As String, size As Integer, Optional logofilepath As String = "", Optional IsURL As Boolean = False, Optional darkcolor As String = "", Optional lightcolor As String = "") As Byte()

    The following overload accepts a logo image in a byte array instead of a logo filepath

    Code Block
    QRCode(content As String, size As Integer, logobytes As Byte(), Optional IsURL As Boolean = False, Optional darkcolor As String = "", Optional lightcolor As String = "") As Byte()

    See the following explanation for each of the arguments

    • content = Text content of the QRCode

    • size = Pixels per module. Large values here can cause out-of-memory errors from the report viewer.

    • logofilepath = Filepath to a logo to embed in the center of the QR Code (example: C:\\myimage.png)

    • logobytes = Byte array of logo to embed in the center of the QR Code. This can be an image field from a dataset (example: Fields!Logo.Value)

    • IsURL = True if the content is a web URL to format the QR Code as a URL Payload

    • darkcolor = Dark color in the QR Code (examples: “black”, “255,255,255”)

    • lightcolor = Light color in the QR Code (examples: “white”, “0,0,0”)

    • Example

      • Expression (Value property on an Image with Source set to Database)

        Code Block
        languagenone
        =Code.QRCode("www.crowsnestsoftware.com", 20, "", True, "Red", "White")
      • Code

        Code Block
        languagenone
        Function QRCode(content as String, size as Integer, logobytes as Byte(), Optional IsUrl as Boolean = False, Optional darkcolor as String = "", Optional lightcolor as String = "")
          Return CrowsNest.Reporting.Images.QRCode(content, size, logobytes, IsURL, darkcolor, lightcolor)
        End Function

...