Jump to content

How to show and hide pages in any Spotfire mode (consumer, desktop, edit, view)?

Henry Heberle

Recommended Posts

Our users all have edit rights and can add visualizations to our main-stream dashboard as they need in their many types of analyses they can derive from our dashboard.

However, some users perform simple tasks, while others require more data and more visualizations.

How can I create a normal flow for Basic and Advanced modes in our main-stream dashboard, that would show or hide pages, regardless of 'view/edit' mode or web/desktop users?

E.g. Basic mode shows 3 pages. Advanced mode shows the first page, hide the other 2, and show other extra 10 pages.

Imagine we have 50 pages, and each mode (or analyses) would use only 5 pages, but the user wants flexibility. And it would be too much work to create 10 different dashboards and maintain them.

Please note that "deactivate" is possible but so far I couldn't find a "hide" option that works for all versions of Spotfire (write and view modes, analyst and consumer). 

Users need to be able to jump to any page at any moment.

Is there a way to "delete" it and add it back later if the user chooses a different mode? aka Archive a page and recover it?

Link to comment
Share on other sites

Not sure if I understood this approach.

So, I create a Document.property Mode to set as 'advanced' or 'basic' according to a checkbox that the user will choose. They choose basic or advanced.

Then I need to ​get UC? And how do I use UC to hide the pages via the same script?

I only found show/hide pages that work with only View mode on the web, as a consumer.​

Thank you!​

Link to comment
Share on other sites

Hello Henry

Yes, you can hide the visibility of the page using an IronPython script. Something like this:

mode = Document.Properties["userMode"]print mode #hide all pages, then unhide accordinglyfor p in Document.Pages: #hide all pages p.Visible = False  #show basic pages whose title starts with a dot" if mode=="basic": p.Visible = p.Title.startswith(".")  #show basic and advanced pages" elif mode=="advanced": p.Visible = p.Title.startswith(".") or not p.Title.startswith("*")   #show pages only for adins elif mode=="admin": p.Visible = p.Title.startswith("*") or p.Title.startswith(".")

Your userMode Document Property can be linked to a DropDown Property Control with manual values such as: 'basic', 'advanced' and 'admin' modes, so when this document property changes, triggers the above script.

The example is very basic. It is only showing how to hide or show pages accordingly, but you can elaborate on the code and make it as sophisticated as you need. For exaample, It can be automatically linked to a lookup table where you store the username or groups, as Kristen mentioned, and get the corresponding visibility level. Take into consideration that any user that can edit the report, can unhide hidden pages.

Link to comment
Share on other sites

Thank you so much for the detailed explanation!

Unfortunately, it only deactivated the pages and didn't hide them.

When I click "arrow-up" to see all page names (when there is not enough space in the screen to see all pages' names), the name of the hidden page still appears there.

If I have 20 pages, I don't want them to take visual space from their dashboard. :(

It only worked in the view mode... but our users have full control of the dashboard and complain of so many pages that they can work with. For each type of analysis, they would work with only 5–10 pages, but we need to make them all available... imagine 30 pages, and they need to look for the page that they have to work with to complete task 1 (5 out of 30 pages).

Link to comment
Share on other sites

Henry, what about using a landing page and a masthead across all pages to allow you to come back to the landing page? Or a masthead that can contain a navigation menu that can show or hide items from the navigation menu (drop-down) depending on some kind of selection switch to change between basic or advanced views?

It's easy to create mastheads for many pages by using a combination of JavaScript and IronPython scripts. These links shows you how to create them and replicate them across all pages.

Link to comment
Share on other sites

I was thinking that you could also have a landing page that loads very quickly. On this page you can have different links pointing to the basic or advanced version of the dashboard.

This approach can be either A) have separate dashboards or B) a dashboard that deletes pages as soon as the analysis opens the first time.

The advantages of the first approach is that the dashboard can load quickly if other pages use too many resources for the basic version. The downside is that you will need to maintain different dashboards, however, this can be automated with Automation Services by creating a copy of the master dashboard with removed pages so that you have to maintain only one version of the file that contains all the pages.

the second approach is good If you analysis has an acceptable loading time. You can trigger an IronPython script that deletes (not hides) the unwanted pages when a document property changes. The document property can be changed from a configuration link parameter that you will have on your landing page. When the document property changes, you can trigger an IronPython script to remove unwanted pages.

Link to comment
Share on other sites

Automation Services to select sets of pages would be very interesting!

However, we don't manage the server, and as I could read, it works on the server level.

Do you have examples of such pages manipulation from some other forum or guide? Just to have it documented here, in case we find a future solution with the responsible for the server we use.

Link to comment
Share on other sites

Sorry for the late reply.

As per the gaps on the top, I recommend using a single text area instead of 3. There is a minimum height on the text area even if you manage to make it really slim by editing the custom visualization theme. What I do is to vertical center and remove the borders and gaps on my custom visual.

Regarding the gap on the footer from your last screenshot, I am afraid it is not possible to remove because there is some key information on the bottom right such as the number of rows, active visualization, filtered rows, progress indicator among other info. I don't think there is a straight forward way, but I'll check in case you really want to remove it all together.

For the Automation Services, yes, it works at the server level, but you can also automate a task and run it on your local machine manually. You can even use windows task scheduler to run these tasks from your machine. For example, create a backup every day, send a report every week via email or whatever the automation services allows you to do. The Automation Services was more for the maintenance of the dashboard to maintain different version of the dashboard, but as you mentioned, this is only additional information for future reference.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...