Demystifying DevExpress XtraReport for Silverlight - Part 1
DevExpress is no doubt - a formidable entity to be reckoned within the sphere of software development. Just in case you are from another planet, it provides third party tools or to be more specific, controls that are used by developers to provide additional functionality not available in the base line controls that come default with Visual Studio and the Dot Net development platform. Specifically, it saves a lot of time and hassle needed to come up with these controls.
To this end, DevExpress has a multi platform tool - called XtraReport - or control - than can be used to generate reports for the Dot Net Environment. Within the Dot Net environment - there are variations or different styles of developing and deploying software. The major players in this realm are - ASP DOT NET Web Forms - which is web based software development tool, WinForms - which is the traditionally Windows based Development and WPF - Windows Presentation Foundation - which is an alternative to WinForms.
The major difference between WinForm and WPF is that - one uses the traditional way of doing things - a designer or IDE with features to specify the source code while the later employs XAML, an XML-based language, to define and link various UI elements. With the traditional way, widgets and controls are dropped or placed in the designer and the IDE automatically generates code in special resource files for these controls. More often than not, the only way to change or manipulate these controls at design time is by using output devices to manipulate them directly through gestures - moving, dragging, expanding and all that.
With WPF instead of specialized files or resources being created to store the design time information of controls, Microsoft has now made it possible to edit and manipulate these controls at design time through scripting using an XML like entity - called XAML Extensible Application Markup Language (pronounced "zammel"). The other major cool thing with XAML is - one can use EXPRESSION to implement a full functional application with little or no formal method based codes or/and event handlers.
Microsoft also came up with a design model called - MVVM - Model-View-ViewModel. Essentially, the design model is supposed to boost productivity by allowing software development tasks to be split amongst functional independent groups or teams. Traditionally, software development has been a one way trajectory, with GUI design, LOB - line of business - requirements and data repository issues all being taking care of by the same team or person and always done sequentially - with Data Repository definitions coming first, then GUI design and finally, LOB enforcements.
With MVVM, these tasks can now be shared amongst teams or people who can commence work without too much dependency on each other. Each stratum of the development process is now a semi autonomous step and which at the end of the day would interact with each other without too much direct dependency. Simply put - MVVM promotes and advocates for loosely coupled systems.
Bear with me folks - some of you may be losing patience already - the title - supposedly is about a DevExpress control, why the unnecessary journey into when the "big bang occurred". I am a fundamentalist - I believe in laying out first the principle before delving into the "how to".
Probably another topic for another blog - I have seen a lot of lead developers in software shops who do terrible jobs in knowledge sharing and mentoring because of their inability to explain the fundamentals. They often times provide solutions to problems without allowing their colleagues or subordinates to understand how and why an application is composed - the building blocks. The flip side to this is that - they - lead developers - end up becoming brain trusts - and the shop can not survive without them. "Nobody is indispensable" is one mantra i think software shops should practice.
Anyway, back on track, Microsoft came up with Silverlight - which is supposed to be the hybrid between WinForms and Web Forms - essentially, allows the user the luxury of using - more appealing and more functionally rich - windows controls in a web environment. Silverlight basically uses the WPF programming model. Silverlight comes in two flavors - called Stand alone and Web enabled or embedded mode. In stand alone mode, the Silverlight application is like the traditional windows application and in web enabled or embedded mode, the Silverlight application is made accessible through a web browser.
The good thing is the application can be written once and deploy in any mode of choice. For strictly Stand alone mode, only one project is needed while for web enabled mode, a web project is needed in addition. The configuration for the web mode is sometimes referred to as client server mode. The client is the Silverlight application itself and the host is the server - which is a web application.
The biggest challenge in Silverlight is that Data Access is always done in asynchronous mode - that is - when retrieving or sending data - one does not wait for the step to be completed. Essentially, a call back hook or routine is provided which is then invoked when Data operation is done. As a consequence of this, things like printing are not easily accomplished and what is normally done is make a call back to the server, prepare the reports and then display it as a web page. The client - Silverlight application - does not really have control over the report.
DevExpress came up with a control - XtraReport - to address some of these shortcomings for reporting purposes - allow the client to still control the reporting process and at the same time, run the report at the server end. What DevEXpress has done is come up with a web Service running on the server and allow the client to consume it. The result sent back is a XAML stream representing the report which the client can then render without losing control or giving control of the process.
The biggest challenge with DevExpress is : there is not enough or better still - there is no sequential - step by step documentation on how to do things. The online documentation provides just the basics of using the control in a silverlight environment with more space devoted to using it in WinForm environment.
This blog entry is aimed at explaining how to go about using XtraReport in a SilverlIght application and what pitfalls one should avoid in order to get the best out of it.
This is the scenario - We have a Sileverlight application with a feature rich set. We are interested in generating a report based on nested master-detail relationships. An example would be a manufacturing concern. We want to see customers' turnover by months and by products. So we want to see something like this showing 3 levels of details.
First level shows customer information with overall Year-To-Date turnovers.
Second level Shows Monthly Overall turnovers
Third level shoes Monthly Details
Customer XYX | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
YTD | Invoice | $10,000 | ||||||||||
YTD | Payments | $7,000 | ||||||||||
YTD | Outstanding | $3,000 | ||||||||||
January | ||||||||||||
|
Comments
Post a Comment