locked
Custom Report View Web Control RRS feed

  • Question

  • I'm trying to build a custom report view plug-in that display an AJAX enabled custom map control. The custom report view client piece works fine, however, when I try to preview the dashboard that contains the custom report view server control, the page shows up blank.  I did not get any errors in the Event Viewer either.  The steps I went through to create the custom report view server control is as follow:

     

    (1) The custom map control I had is embeded within an ASP.Net User Control, due to the complexity of the page layout, I kept it as a user control, and convert it to a custom control using the Publish Web Site feature in ASP.NET 2.0, and select the "Use fixed naming and single page assemblies" option to generate a standalone dll for the user control.

     

    (2)Loaded the resulting the assembly to the GAC

     

    (3)Added the dll onto a regular aspx page in a separate web site as a custom control, and validate that my custom map control still worked.

     

    (4)I created a custom report view server control using the template provided in the SDK (MyReportViewWebControl.cs), overloaded the CreateChildControls and Render methods to load the custom control exactly the same way as how I did it in step 3:

     

    protected override void CreateChildControls()

    {

    base.CreateChildControls();

     

    ASP.MyMap map = new ASP.MyMap();

    this.Controls.Add(map);

    }

    protected override void Render(HtmlTextWriter output)

    {

    EnsureChildControls();

    base.Render(output);

    }

     

    (5)Compiled the assembly and add it to the GAC.

     

    (6)Previewed the Dashboard with the Report View, the page showed up blank, the control was not loaded.

     

    Does anyone know if there is any limitation as to what kind of controls can be used when inheriting from the ParameterizableControl?  Also, when it errors out and display a blank screen, where can I find more debug information about it?

     

    Any help is much appreciated!

     

    Thanks,

    Feichi

     

    Tuesday, December 4, 2007 10:31 PM

Answers

  • Feichi,

     

    There are some significant differences between a PerformancePoint dashboard item Web Part and a regular SharePoint Web Part. 

     

    SharePoint does not yet support asynchronous processing in its web parts and filter model.  Consider the case: a regular SharePoint 12 web part page with a web part (a filter for example) that parameterizes (filters) another web part.  In this case, when a browser user changes the filter value selection, the web page "page posts", and the browser repaints the whole page.

     

    PPS 2007 does not work this way.  PPS 2007 Dashboards were built from the ground up to use asynchronous processing in their web part, filter, and conditional visibility models.  Specifically, we use AJAX.  That means, when you inherit from the PPS 2007 ParameterizableWebPart control, you get all this functionality "for free".  In this case, when a browser user changes the filter value selection on the face of a PPS 2007 Dashboard, ONLY the dashboard items that were linked to the filter control will be repainted, AND each of them will be re-rendered on a different callback thread in the browser.  What you have with PPS 2007 is a modern, AJAX driven rich internet application.

     

    The only bad news is: you can't charge ahead and build a Web Part for PPS 2007 in the same way you would a SharePoint 12 web part.  You have to take PPS 2007's patterns into consideration.

     

    The good news is: if you follow the PPS 2007 patterns for building your custom Web Parts, the part will work fine, and you'll get the better user experience that comes with a modern, AJAX driven rich internet application.

     

    Good news for you in particular: It sounds like the custom control you want to build will use AJAX itself, so that control will be in good company with the controls that come with PPS 2007 right out of the box.

     

    To get started, please follow the steps suggested by my blog article "Creating a Custom Report View Plug-in for PerformancePoint Server 2007".  That article and code sample is at:

     

    http://blogs.msdn.com/performancepoint/archive/2007/09/17/creating-a-custom-report-view-plug-in-for-performancepoint-server-2007-code-sample.aspx

     

    Admittedly, the steps you'll follow will result in a code sample that is pretty simple.  But it will get your control to live in the PPS 2007 framework.  Once you've got that far, try modifying the control slowly to get whatever custom desired effect you want.

    Wednesday, December 5, 2007 9:55 PM

All replies

  • Some more information to add, if I create a regular SharePoint Web Part using the same custom map control (ie. inherits from System.Web.UI.WebControls.WebParts.WebPart instead of ParameterizableControl), it works fine when I view it in SharePoint.  How is a PerformancePoint Dashboard Item Web Part differs from a regular SharePoint Web Part?

     

    Thanks,

    Feichi

     

    Wednesday, December 5, 2007 8:15 PM
  • Feichi,

     

    There are some significant differences between a PerformancePoint dashboard item Web Part and a regular SharePoint Web Part. 

     

    SharePoint does not yet support asynchronous processing in its web parts and filter model.  Consider the case: a regular SharePoint 12 web part page with a web part (a filter for example) that parameterizes (filters) another web part.  In this case, when a browser user changes the filter value selection, the web page "page posts", and the browser repaints the whole page.

     

    PPS 2007 does not work this way.  PPS 2007 Dashboards were built from the ground up to use asynchronous processing in their web part, filter, and conditional visibility models.  Specifically, we use AJAX.  That means, when you inherit from the PPS 2007 ParameterizableWebPart control, you get all this functionality "for free".  In this case, when a browser user changes the filter value selection on the face of a PPS 2007 Dashboard, ONLY the dashboard items that were linked to the filter control will be repainted, AND each of them will be re-rendered on a different callback thread in the browser.  What you have with PPS 2007 is a modern, AJAX driven rich internet application.

     

    The only bad news is: you can't charge ahead and build a Web Part for PPS 2007 in the same way you would a SharePoint 12 web part.  You have to take PPS 2007's patterns into consideration.

     

    The good news is: if you follow the PPS 2007 patterns for building your custom Web Parts, the part will work fine, and you'll get the better user experience that comes with a modern, AJAX driven rich internet application.

     

    Good news for you in particular: It sounds like the custom control you want to build will use AJAX itself, so that control will be in good company with the controls that come with PPS 2007 right out of the box.

     

    To get started, please follow the steps suggested by my blog article "Creating a Custom Report View Plug-in for PerformancePoint Server 2007".  That article and code sample is at:

     

    http://blogs.msdn.com/performancepoint/archive/2007/09/17/creating-a-custom-report-view-plug-in-for-performancepoint-server-2007-code-sample.aspx

     

    Admittedly, the steps you'll follow will result in a code sample that is pretty simple.  But it will get your control to live in the PPS 2007 framework.  Once you've got that far, try modifying the control slowly to get whatever custom desired effect you want.

    Wednesday, December 5, 2007 9:55 PM
  • Eric,

     

    Thanks so much for replying and explaining the PerformancePoint Web Part Framework, this helps... I have also looked at your article and code sample at the PerformancePoint blog, it has helped me a lot in getting a basic report view plug-in running. I have a few more questions below hope you'll be able to help:

     

    (1)The reason I start out creating my custom Report View Server Control from a User Control is because I'd like to have more design time control over the controls layout and positioning, I can probably change my code to create a pure composite server control, but that requires significantly more work to do the layout, and setting control properties etc. without the help of the Visual Studio Web Form Designer at design time. Based on your knowledge of the PerformancePoint Web Part AJAX Framework, is there a way for us to still use a User Control within the web part?

     

    (2)When the users click on a cell in a score card, or uses a filter that is tied to my custom report web control, is it possible for me to only refresh part of my web control (for example, only the map content of my custom report web control, but not the tool bar, side bar etc.). Would the PerformancePoint Web Part Framwork recreate a new instance of my custom report web control or would it retain the original instance?  Would it be possible for me to tie in to the ICallbackEventHandler.GetCallbackResult() handler when the filter event is triggered? 

     

    (3)When a user performs some actions within a Report View Server control, is it possible for me to raise an event to trigger a filter or drilldown in an analytic chart report view?

     

    Thanks,

    Feichi

    Thursday, December 6, 2007 4:39 PM
  • Feichi,

     

    Thanks for continuing this discussion inside of TechNet.  I think others have the same questions that you do, and they will benefit from being able to search the internet for the details of this post.  To answer your questions...

     

    1) I don't enjoy creating extra work for you, but "yes", for sure I would discard the UserControl as a basis for your development, and start with the control in the code sample in my blog.  Add whatever you need to the source of that control, and see how far you can take it.

     

    2) The PerformancePoint Web Part Framwork recreate a new instance of your custom report web control every time it refreshes...  If you need portions of your control to "live" between refreshes, you'll have to push that caching into some other medium.  I recommend that you cache into a database in your server farm that can be reached by all of your web servers.

     

    2a) Also in your question 2) you ask, "Would it be possible for me to tie in to the ICallbackEventHandler.GetCallbackResult() handler when the filter event is triggered?"  So: let me paint a picture, and then you tell me if you want your web control to live in that picture.  When a PPS 2007 Dashboard has filter controls on it, and the user selects new values for one or more of those filter controls in the client side browser, and your web control is dependent on those filter controls, then you want your web control to refresh or partially refresh.  Am I right so far?  If that is the case, then you don't have to code any of the asynchronous processing yourself.  The GetCallBackResult won't appear in your control.  We've done it all for you.  What will happen is:

    * Code we've put in the client side browser page will determine if your web control is dirty based on the filter controls your web control is subscribed to.

    * If dirty, code we've put in the client side browser page will put up some kind of "operation in progress..." glass notice over your web control.

    * If dirty, code we've put in the client side browser page will call a web method called RenderingService.CreateRenderingInstructions.

    * The CreateRenderingInstructions web method will spin up a SERVER SIDE copy of your web control, render it to dhtml, and return that dhtml as the return value of that web method.

    * Code we've put in the client side browser page will receive the new dhmtl from the web method and render it to the face of the web page.

     

    3) Emitting filters from your web control into another custom report view you've created is supported.  However, emitting filters from your web control into a PPS 2007 Analytic Chart is complex enough to the point where I won't be given approval to help you write that.  You can try it, it can be made to work, but it is complex.  I wish I could help you do it.  I love the pluggability feature of this product, and I sincerely hope that you don't give up.  Is there some way that you could use PPS 2007 filter emitters instead?

    Thursday, December 6, 2007 5:03 PM
  • Eric,

     

    Thanks for continuing the discussion too, this is helpful for me, I'm being able to picture what is working behind the scene better now. Some more questions for you if you wouldn't mind...

     

    (1) In answering question 3 above, you mentioned that "Emitting filters from your web control into another custom report view you've created is supported", would you mind show us how to do that?  Any specific interfaces I need to implement or how do I pass the filter value out from my web control to another web control? 

     

    (2)Also related to your answer for question 3 above,  I think it is possible for me to use PPS 2007 filter emitters if I can dynamically change the selected filter value that is bind to the Analytic Chart at runtime.  Is it possible for me to dynamically select a filter value or a Scorecard KPI through code from my web control?

     

    (3)If I have a list of report views that are stacked together in a single web part zone, is it possible for me to dynamically switch to a specific one of them through code from my custom web control?

     

    Thanks,

    Feichi 

     

    Thursday, December 6, 2007 7:23 PM
  • One other thing I notice while trying to create a custom report view web control is that, any server controls or its child controls I'm trying to load into the PerformancePoint web part cannot have any dependencies on the Page object. Since the loading of the PerformancePoint web part doesn't go through the full web form life cycle, control.Page is actually Null when the server control is loading.  Unfortunately the map control I'm trying to embed has this dependency, so I haven't been able to get it working even after I created a pure composite server control.  Has anyone run into the same issue and have any suggestions?

     

    Thanks,

    Feichi

     

    Friday, December 7, 2007 7:27 PM
  • Feichi,

     

    You ask a lot of great questions.  Unfortunately, I've only been able to get approval to provide specific custom code guidance for some, but not all of your questions.

     

    One of your (excellent) questions is:

    "Emitting filters from your web control into another custom report view you've created is supported", would you mind show us how to do that?

     

    Let's just say that I owe you another blog entry that will explain this.  (That way you and everyone else will benefit.)  The new blog entry may take some time, don't look for it immediately.  Once I've posted it, I will circle back to this thread and post a link to it.  Thanks for all the great questions,

     

    -Eric

    Monday, December 10, 2007 5:41 PM
  • Hi there, let me join the discussion.

     

    Feichi have u achieved what u intend? I am facing exactly the same problems. Basically i want to create custom controls inside ReportView (something that is simple to do inside Web Parts -> CreateChildControl) and can't do that.

     

    My objective is to create a page with only one filter that can filters all page, including PPS items and non PPS items (like google map).

    I am trying to do that inside ReportView... but now i am thinking in another possible solution. Is it possible to get the selected filter in an environment outside PPS Web Part. I mean, is it possible to create a custom Web Part that can receive a PPS filter? 

     

    Nuno Ferreira

     

     

    Monday, March 10, 2008 11:42 AM
  • Hi Nuno,

     

    It looks like if the custom control has a reference to the Page object, it will not load within the Report View web part because it does not go through the web form life cycle.  I also run into issues where it wouldn't execute Java Script block during load.  If anyone knows how to workaround that I'd really appreciate the help.

     

    The only way I can think of passing the filter to a non PPS items would be to use the Web Page Report View (i.e. have your non PPS item in a separate page, and bring it in through the web page report view which is basically an iFrame, and the filter will be passed through query string), would that work for you?

     

    Thanks,

    Feichi

     

    Thursday, March 20, 2008 7:53 PM
  • Hi Feichi,

     

    Bring my non PPS item through the Web Page Report View is probably a nice solution. But I am not sure how to pass the filter through query string to that Web Part. Can u help me with that?

     

    Thanks in advance

    Nuno

    Tuesday, April 1, 2008 10:21 AM
  • I have more information/doubts to launch:

     

    When we select a PPS filter value there is a table in Database that is going to be "refreshed".

    I am talking about dbo.ParameterValues table in PPSPlanning Database.

    In there, there is a Column named SerializedXml that contains the last selected value in filter (tag <key>)

     

    But now I have 2 problems:

    (1)One is getting the value (key), because it is coded

    ..i could try mapping the values (for each coded name trace the "friendly" name) but... is not a good solution (maybe impossible Smile)

    (2)Suppose i decode that value, how can i use it in my page to automatically edit/refresh my non PPS item? The only solution I remember is to provoke a regular refresh in page to post back..

     

    Nuno

    Tuesday, April 1, 2008 11:34 AM
  • So, how does PPS deal with connected web parts?  User selects a data item, I want to update a separater dashboard web part/item/whatever.  Can I plug into the javascript or control how/where the AJAX posts?

    Am I making any sense?
    Ruprict
    Monday, April 7, 2008 9:23 PM