Reporting and Tab Control

2 posts, 0 answers
  1. Jonathan
    Jonathan avatar
    11 posts
    Member since:
    Apr 2014

    Posted 30 Dec 2014 Link to this post

    I am using PRISM/Unity and Telerik's WPF controls to create a business solution for generating and viewing reports.  I have a module that is dedicated to simply displaying the generated reports.  My View for the reports originally was implmented as a <Window> </Window> with a single <ReportViewer> with the report data source bound to a backing field in the ViewModel for the Window.  I am now attempting to convert to a tabbed control structure to allow the users to view more than one report at a time.  I VM defined as a static resource in the window and the codebehind of the window exposes a single method that allows the addition of reports to its tab control (given that it's entirely a piece of display functionality, I don't think it violates the MVVM principles.

    Back to the question:  during the add process, I generate an instance report source and add it to an ObserableCollection<InstanceReportSource> that is the ItemSource bound to the "ItemSource" property of the tab control and then show the window that contains the Tab Control. During the AddReport method, I perform a RaisePropertyChanged("ReportSourceCollection") to notify the Tab control that it needs to add a new tab containing a report.  The issue I'm running into is that when the window opens, no report is displayed.  Through my debugging, I've found that the addition of items, and property changed events are properly raised.

    Has anyone else had an issue with Report Viewer in the Tab control?

  2. Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 02 Jan 2015 Link to this post

    Hello Jonathan,

    I have attached a very simple project demonstrating a bound tab control. Upon a button click, an item is inserted in the tabs collection of the view model and the tab control immediately creates a new tab for the new item. Do give it a try and see how it goes.

    I am unsure how you have implemented this in your actual application, but I hope that you will be able to find the differences with the project I sent and adopt the same approach. If you need further assistance with this, please modify the project to mimic your set up and to reproduce the behavior so that we can investigate it.

    Petar Marchev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top