If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Open Properties for Report Studio

Started by shelby435, 25 Jun 2017 05:11:38 PM

Previous topic - Next topic

shelby435

Does anyone know how to properly edit the JSON to open up more of the properties for Report Studio?

I have to change the palette for the same viz (az.viz) several times and Im trying to avoid having to import the same visualization 5 times all with different palettes.

I'd like to open the palette property but I just have no idea how. I know it used to available but I don't see it.

Thanks!

MFGF

Quote from: shelby435 on 25 Jun 2017 05:11:38 PM
Does anyone know how to properly edit the JSON to open up more of the properties for Report Studio?

I have to change the palette for the same viz (az.viz) several times and Im trying to avoid having to import the same visualization 5 times all with different palettes.

I'd like to open the palette property but I just have no idea how. I know it used to available but I don't see it.

Thanks!

Hi,

It's possible to modify visualizations to add a palette property (and defined palettes) if you know what you are doing. You're going to need the Visualization Customizer utility from the DeveloperWorks website, and some snippets of code for the Chart Type Definition, Parameters and String Resources sections of the vizJSON code. You will also need someone with Administrator privileges to import the revised visualizations and make them available for you to use in Cognos. Let me know if you need further details / code snippets.

Cheers!

MF.
Meep!

shelby435

Thank you MFGF. I knew I was going to have to edit the JSON with the customizer and all that, and it was exactly that I didn't know what to write. I didn't know what string resources or parameters to call.

I did receive code snippets from someone and going to try to implement that.

Thank you for replying.

adicognos

Hi MFGF-

Can you please share the snippets that need to be added to the json script in order to render all the additional properties in RS.

Thanks in advance
Adi

Joscha

Hi adicognos,

you have to add the following code to your json script (example is for palette with 10 different Colors):

{
   "parameters":
   [

      {
         "id":"paletteValueColor0",
         "required":false,
         "type":"color",
         "defaultValue":"blue",
         "resolution":
         [
            {
               "method":"set",
               "target":"/grammar[*]/elements[*]/color[*]/mapping[0]/color",
               "sourceParameter":"paletteValueColor0"
            }
         ]
      },
      {
         "id":"paletteValueColor1",
         "required":false,
         "type":"color",
         "defaultValue":"blue",
         "resolution":
         [
            {
               "method":"set",
               "target":"/grammar[*]/elements[*]/color[*]/mapping[1]/color",
               "sourceParameter":"paletteValueColor1"
            }
         ]
      },
      {
         "id":"paletteValueColor2",
         "required":false,
         "type":"color",
         "defaultValue":"#9292FF",
         "resolution":
         [
            {
               "method":"set",
               "target":"/grammar[*]/elements[*]/color[*]/mapping[2]/color",
               "sourceParameter":"paletteValueColor2"
            }
         ]
      },
      {
         "id":"paletteValueColor3",
         "required":false,
         "type":"color",
         "defaultValue":"#9292FF",
         "resolution":
         [
            {
               "method":"set",
               "target":"/grammar[*]/elements[*]/color[*]/mapping[3]/color",
               "sourceParameter":"paletteValueColor3"
            }
         ]
      },
      {
         "id":"paletteValueColor4",
         "required":false,
         "type":"color",
         "defaultValue":"#FFFFD3",
         "resolution":
         [
            {
               "method":"set",
               "target":"/grammar[*]/elements[*]/color[*]/mapping[4]/color",
               "sourceParameter":"paletteValueColor4"
            }
         ]
      },
      {
         "id":"paletteValueColor5",
         "required":false,
         "type":"color",
         "defaultValue":"#FFFFD3",
         "resolution":
         [
            {
               "method":"set",
               "target":"/grammar[*]/elements[*]/color[*]/mapping[5]/color",
               "sourceParameter":"paletteValueColor5"
            }
         ]
      },
      {
         "id":"paletteValueColor6",
         "required":false,
         "type":"color",
         "defaultValue":"#FF9999",
         "resolution":
         [
            {
               "method":"set",
               "target":"/grammar[*]/elements[*]/color[*]/mapping[6]/color",
               "sourceParameter":"paletteValueColor6"
            }
         ]
      },
      {
         "id":"paletteValueColor7",
         "required":false,
         "type":"color",
         "defaultValue":"#FF9999",
         "resolution":
         [
            {
               "method":"set",
               "target":"/grammar[*]/elements[*]/color[*]/mapping[7]/color",
               "sourceParameter":"paletteValueColor7"
            }
         ]
      },
      {
         "id":"paletteValueColor8",
         "required":false,
         "type":"color",
         "defaultValue":"#FF0000",
         "resolution":
         [
            {
               "method":"set",
               "target":"/grammar[*]/elements[*]/color[*]/mapping[8]/color",
               "sourceParameter":"paletteValueColor8"
            }
         ]
      },
      {
         "id":"paletteValueColor9",
         "required":false,
         "type":"color",
         "defaultValue":"#FF0000",
         "resolution":
         [
            {
               "method":"set",
               "target":"/grammar[*]/elements[*]/color[*]/mapping[9]/color",
               "sourceParameter":"paletteValueColor9"
            }
         ]
      }
   ],
   "data":
   [
...



The palette code I was using looked like that:

"grammar":
   [
      {
         "coordinates":
         {
            "dimensions":
            [
               {
                  "scale":
                  {
                     "spans":
                     [
                        {
                           "fit":"exact"
                        }
                     ]
                  }
               },
               {
                  "scale":
                  {
                     "spans":
                     [
                        {
                           "fit":"exact"
                        }
                     ]
                  }
               }
            ],
            "transforms":
            [
               {
                  "type":"projection",
                  "projectionParameters":
                  {
                     "name":"simple"
                  }
               }
            ]
         },
         "elements":
         [
            {
               "type":"polygon",
               "data":
               {
                  "$ref":"dataSet"
               },
               "color":
               [
                  {
                     "field":
                     {
                        "$ref":"size"
                     },
                     "mapping":
                     [
                        {
                           "at":"symmetricLower",
                           "color":"blue"
                        },
                        {
                           "at":-1.500001,
                           "color":"blue"
                        },
                        {
                           "at":-1.5,
                           "color":"#9292FF"
                        },
                        {
                           "at":-0.50000001,
                           "color":"#9292FF"
                        },
                        {
                           "at":-0.5,
                           "color":"#FFFFD3"
                        },
                        {
                           "at":0.4999999999,
                           "color":"#FFFFD3"
                        },
                        {
                           "at":0.5,
                           "color":"#FF9999"
                        },
                        {
                           "at":1.4999999,
                           "color":"#FF9999"
                        },
                        {
                           "at":1.5,
                           "color":"#FF0000"
                        },
                        {
                           "at":"symmetricUpper",
                           "color":"#FF0000"
                        }
                     ]
                  }
               ],


And this is the code you need to embed in the Chart type Definition:

</enumProperty>
<integerProperty name="width">
<label ids="lblWidth"/>
<description ids="viz_width"/>
<defaultInteger>600</defaultInteger>
</integerProperty>
<integerProperty name="height">
<label ids="lblHeight"/>
<description ids="viz_height"/>
<defaultInteger>600</defaultInteger>
</integerProperty>
<colorProperty name="paletteValueColor0">
<label ids="lblPaletteValueColor0"/>
<tooltip ids="tooltipPaletteValueColor0"/>
<description ids="descPaletteValueColor0"/>
<defaultColor>
<RGBA r="0" g="0" b="255"/>
</defaultColor>
</colorProperty>
<colorProperty name="paletteValueColor1">
<label ids="lblPaletteValueColor1"/>
<tooltip ids="tooltipPaletteValueColor1"/>
<description ids="descPaletteValueColor1"/>
<defaultColor>
<RGBA r="0" g="0" b="255"/>
</defaultColor>
</colorProperty>
<colorProperty name="paletteValueColor2">
<label ids="lblPaletteValueColor2"/>
<tooltip ids="tooltipPaletteValueColor2"/>
<description ids="descPaletteValueColor2"/>
<defaultColor>
<RGBA r="146" g="146" b="255"/>
</defaultColor>
</colorProperty>
<colorProperty name="paletteValueColor3">
<label ids="lblPaletteValueColor3"/>
<tooltip ids="tooltipPaletteValueColor3"/>
<description ids="descPaletteValueColor3"/>
<defaultColor>
<RGBA r="146" g="146" b="255"/>
</defaultColor>
</colorProperty>
<colorProperty name="paletteValueColor4">
<label ids="lblPaletteValueColor4"/>
<tooltip ids="tooltipPaletteValueColor4"/>
<description ids="descPaletteValueColor4"/>
<defaultColor>
<RGBA r="255" g="255" b="211"/>
</defaultColor>
</colorProperty>
<colorProperty name="paletteValueColor5">
<label ids="lblPaletteValueColor5"/>
<tooltip ids="tooltipPaletteValueColor5"/>
<description ids="descPaletteValueColor5"/>
<defaultColor>
<RGBA r="255" g="255" b="211"/>
</defaultColor>
</colorProperty>
<colorProperty name="paletteValueColor6">
<label ids="lblPaletteValueColor6"/>
<tooltip ids="tooltipPaletteValueColor6"/>
<description ids="descPaletteValueColor6"/>
<defaultColor>
<RGBA r="255" g="153" b="153"/>
</defaultColor>
</colorProperty>
<colorProperty name="paletteValueColor7">
<label ids="lblPaletteValueColor7"/>
<tooltip ids="tooltipPaletteValueColor7"/>
<description ids="descPaletteValueColor7"/>
<defaultColor>
<RGBA r="255" g="153" b="153"/>
</defaultColor>
</colorProperty>
<colorProperty name="paletteValueColor8">
<label ids="lblPaletteValueColor8"/>
<tooltip ids="tooltipPaletteValueColor8"/>
<description ids="descPaletteValueColor8"/>
<defaultColor>
<RGBA r="255" g="0" b="0"/>
</defaultColor>
</colorProperty>
<colorProperty name="paletteValueColor9">
<label ids="lblPaletteValueColor9"/>
<tooltip ids="tooltipPaletteValueColor9"/>
<description ids="descPaletteValueColor9"/>
<defaultColor>
<RGBA r="255" g="0" b="0"/>
</defaultColor>
</colorProperty>


...and String Resources:
lblPaletteValueColor0=Farbe Kategorie 1
tooltipPaletteValueColor0=Farbe Kategorie 1
descPaletteValueColor0=Farbe Kategorie 1
lblPaletteValueColor1=Farbe Kategorie 2
tooltipPaletteValueColor1=Farbe Kategorie 2
descPaletteValueColor1=PaletteValueColor2
lblPaletteValueColor2=Farbe Kategorie 3
tooltipPaletteValueColor2=PaletteValueColor3
descPaletteValueColor2=PaletteValueColor3
lblPaletteValueColor3=Farbe Kategorie 4
tooltipPaletteValueColor3=PaletteValueColor4
descPaletteValueColor3=PaletteValueColor4
lblPaletteValueColor4=Farbe Kategorie 5
tooltipPaletteValueColor4=Farbe Kategorie 5
descPaletteValueColor4=Farbe Kategorie 5
lblPaletteValueColor5=Farbe Kategorie 6
tooltipPaletteValueColor5=Farbe Kategorie 6
descPaletteValueColor5=Farbe Kategorie 6
lblPaletteValueColor6=Farbe Kategorie 7
tooltipPaletteValueColor6=Farbe Kategorie 7
descPaletteValueColor6=Farbe Kategorie 7
lblPaletteValueColor7=Farbe Kategorie 8
tooltipPaletteValueColor7=Farbe Kategorie 8
descPaletteValueColor7=Farbe Kategorie 8
lblPaletteValueColor8=Farbe Kategorie 9
tooltipPaletteValueColor8=Farbe Kategorie 9
descPaletteValueColor8=Farbe Kategorie 9
lblPaletteValueColor9=Farbe Kategorie 10
tooltipPaletteValueColor9=Farbe Kategorie 10
descPaletteValueColor9=Farbe Kategorie 10



Maybe this helps...?