After a long break from blogging, it's time to get back on the course. In the last weeks I worked hard on two BI projects so I didn't had any time to write, but the good news is that I learned a lot and now I have more to share. Now, let's talk about the Panorama Dashboards web site.
When you build many pages with the NovaView Dashboards, you often find yourself repeating the same code and actions in different pages, which stands in conflict with the DRY principle. The solution to this problem is to maintain a global javascript file and reference it from your custom code. That way, you'll edit only one js file all the time. Take my advice and put the file in VSS or any other source control. Every page's custom code will be only the code which is unique to the page. The bigger problem is that during development, you still need to create many pages, reference them to the global js file and make very page's own manipulations. I don't have a silver bullet solution, but the next tip can save you much development time.
Warning: Before doing anything with your DB, back it up.
Behind the Dashboards web site, there's a little database called PanoramaDashboard which contains all the web site's data. In this post, I'll discuss the Tabs table. The Tabs table is maybe the most important table in this DB. Every row in that table is a page in the Dashboards web site. When I create a new page that is very similar to another one, I click on "Create a copy" in the web site (on design mode, of course) and then I run the following SQL command in the DB:
use [PanoramaDashboard]
Update Tabs
set
CustomCode = (select CustomCode from Tabs where Id=YourPreviousPage'sId),
UseCustomCode = 1,
Name = TheNewPage'sName
where Id = (the new page Id. You can see in the page's address in the address bar)
After that, edit the custom code from the DB (very similar SQL command). You'll have to enter manually the new Applets names/Ids. Don't try to duplicate the page using the DB because it won't work.
If you did some mess with the order of the pages in the section or you just want to re-organize the pages, you can re-order it using the same Table. Just change the FatherId of the page. Note that a father must be a folder, so you need to set Folder=1 and that a page with no father will have FatherId=-1. Again - don't try to enter manually a whole row because it will break the web site (you'll have to remove the identity from the Id column and that can cause you much trouble).
Enjoy. and be careful.