Forum Discussion

OSAdmin's avatar
OSAdmin
Valued Contributor
5 years ago

Has anyone any examples of using Cubeview extender rules to change the logo displayed in a report based on the entity selected

Originally posted by Matt Grundey

11/6/2017

Hi, has anyone any examples of using Cubeview extender rules to change the logo displayed in a report based on the entity selected. I'm aware that this wouldn't work where entities are shown in rows or columns. I can't see any examples of passing in parameters into these rules that could identify the entity, nor can I see from the reference doc how I can get the entity that the report is using. 

  • OSAdmin's avatar
    OSAdmin
    Valued Contributor
    Originally posted by Steve Mebius

    I got a basic example working which used workflow assigned entities and read a text property on the first entity in order to pass the logo name into the filepath. I tested further and managed to get an example working which read the Cubeview POV entity and passed this into the logo filepath. I then saved a different logo for each entity. It seems to work, atleast well enough for me to tell the partner it should be feasible, without creating numerous versions of the same report. Here is the sample of that last example:
    Case Is = CVExtenderFunctionType.FormatReportUIItem
    Dim uiItem As CVExtenderReportUIItem = args.Report.CurrentUIItem

    If uiItem.UIItemType = XFReportUIItemType.PageHeaderPictureBoxLogo Then
    '-------------------------------
    Dim objKeyedByDimTypeInt As KeyedByDimTypeList(Of CubeViewPOVMember) = args.CubeView.CubeViewPovMembers
    Dim TextValue As String = objKeyedByDimTypeInt.Entity.Name
    '----------------------------

    uiItem.SetPictureBoxImage(FileSystemLocation.ApplicationDatabase,""Documents/Public/DashboardImages/"" & TextValue & "".png"",TriStateBool.TrueValue)
    End If

  • OSAdmin's avatar
    OSAdmin
    Valued Contributor
    Originally posted by Bart DeHaas

    Here is how I have done it. It actual put a different logo depending on the company.

    Case Is = CVExtenderFunctionType.FormatReportUIItem
    Dim uiItem As CVExtenderReportUIItem = args.Report.CurrentUIItem
    uiitem.FontFamily = "Calibri"
    uiitem.FontSize = 11

    If uiItem.UIItemType = XFReportUIItemType.PageHeaderPictureBoxLogo Then


    If args.CubeView.CubeViewPovMembers.Entity.Name.Contains("SV") Then


    uiItem.SetPictureBoxImage(FileSystemLocation.ApplicationDatabase,"Documents/Public/tb_special vehicles_rgb.png", TriStateBool.TrueValue)
    uiItem.Height = 30
    uiItem.width = 150

    • Sergey's avatar
      Sergey
      Contributor III

      The last two rows were messing up the cube view, but the code works great, thanks for this message !