Total Pageviews

Search This Blog

Wednesday, June 8, 2011

Tip – EP Customization ( Dynamically Loading Report Folder from Network based on Store Parameter)


Overview
I had this requirement where based on the logged in Store Number, the user should be able to open the corresponding Report Store Folder (located in an UNC Network Path) from Enterprise Portal web page

Solution/WorkArounds:
Initially, tried writing a separate web part which loads a .Net File Dialog user control box but it was turning out to be complex so left the approach as time was limited
Then, tried the out of the box Page Viewer Web Part but it has the limitation wherein you can't dynamically load the network path and in order to attain it, one needs to write a custom Dynamic Page Viewer Web Part which is another time consuming and complex customization.
After some investigation, I found a much simpler way to achieve this.
  1. Wrote a dynamic Java Script which queries the Network Path from AX Table
  2. Pass the store parameter to it
  3. Loads the UNC Path dynamically on the fly based on the store parameter
This is the code segment which picks up the Network Path and then dynamically appends the store id to it based on the logged in user's store id profile

  
Tip: Initially, I was using the ClientScript.RegisterStartupScript method to register the script block but landed into the same issues this bloke was facing when trying to load from webpartzone.
, ScriptManager came to my rescue here.
Below is the button in action on our portal Site (Role Center Page) which loads the network Report path
   

No comments: