Posts

Showing posts from July, 2013

Troubleshooting WPF (Debugging WPF)

Image
This article I came across while googling for the best way to debug bindings in XAML. I am just reproducing just in case the original link gets broken. Introduction   Windows Presentation Foundation (WPF) is a joy to develop rich user experiences with. Animations, bindings, reskinnable codeless interfaces, all backed up with traditional .Net programming all make for a very rapid development cycle. However, when something goes wrong in that autogenerated super-sexy front-end, it is not always clear where the problem is.   This article will cover some of the methods for analyzing your WPF application, troubleshooting issues, and debugging seemingly obscure errors.     Binding Errors   When an error occurs in the binding framework, the notification is usually "silent", in that is doesn't pop up an error dialog to the user. The error is instead displayed in the Output Window  of Visual Studio. Althoug...

Demystifying DevExpress XtraReport for Silverlight - Part 5

Image
part 1 >> This is the final part of what ideally should have been a three part write-up but has been split into a 5 part write-up. This part deals with the actual consumption or running of the report. To recap, to use DevExpress XtraReport control in Silverlight - one needs a web service broker - consumed by the client and which in return calls the appropriate report and streams back a valid XAML to the client which then displays it. To consume or run the report from the client, one just needs a DocumentPreview Control which can be specified at design time or left till when needed at runtime. The thing to note when included at design time is to set the AutoCreateDocument to false to prevent the report from running automatically whenever the class it is included is instantiated. When invoking the reports, parameters values can be assigned. By default, the report is expected to pop-up a parameter dialog box when run for input. This action cam be suppressed by setting c...

Demystifying DevExpress XtraReport for Silverlight - Part 4

Image
part 5 >> This is the second step of the tasks - probably this should have been done first but it should not really mater. As you may recall, for Silverlight applications using Devexpress report control, the report is implemented as a Client-Server process using web services. Essentially, a web service call is made from the server which in turn runs the report and then returns an XAML representing the formatted report to the client. So, a web service needs to be installed on the server for this purpose. DevExpress has a template web service in place - so, all that is needed is use it and then do any house cleaning necessary. Just to get you in the right frame of mind - this is like a clearing house for all reports to be printed. Here, for each report requested, one needs to instantiate it before it can run. To set this up, select the Server side or Web project for the Silverlight application. Then, right click and select "DXperience vxx Report Service". The...

Demystifying DevExpress XtraReport for Silverlight - Part 3

Image
part 4 >> Below are code snippets used in putting it all together. The first snippet is the event handler for DATASOURCE DEMANDED. Here you can change the datasouce for the report and also filter or do any other house cleaning for the report's datasource. The second snippet is the event handler for the BEFOREPRINT event for the subreprot control. This is actually the best place to bind the datasource for the subreport's report. If you use the DATASOURCE DEMANDED for the subreport - you are likely to get duplicate data printed. The last two snippets of code are just generic routines that can be used to propagate automatically all the parameter values for the master into the details and as well as assign new parameter values. Another good thing to bear in mind are these Report Class methods - GetCurrentRow - which returns an object implementing the System.Collections.IList interface the return value will be an item from the collection represented by th...

Demystifying DevExpress XtraReport for Silverlight - Part 2

Image
part 3 >> There are 3 steps involved here. One create/design the reports Two Create the Report Service Three consume the report from the Silverlight Application From the report layout - one can deduce that at least two levels of master-detail will be needed. The first Master-Detail is the customer information with the Total YTD figures. The Detail to that is the Monthly Figures for the given Customer. That now serves as a master to yet another detail which will be the actual details of purchases by the customer for the given month. I am assuming you have Visual Studio as well as the necessary DevExpress for Silverlight products installed with the XtraReport as an offering. I am also assuming you have a Client-Server Silverlight Solution. So, having said that, we'll go to the meat of the design. In the server side project or web project, create a sub folder - it is not required but I like to compartmentalize similar things - called Reports. From the Repo...

Demystifying DevExpress XtraReport for Silverlight - Part 1

part 2 >> 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 alter...

Simplified UI Printing in Silverlight

I came across this post and it is probably - code on steroids - very neat and powerful, Basically allows you to tweak certain attributes of an object when printed within Silverlight. The standard class - PrintDocument provided for Silverlight does not expose a lot of things and as such, makes such simple tasks as wrapping, shrinking and all other - taken for granted - printing features a pain in the butt. To be fair - you may be able to overcome some of these short comings by using third party controls - like DevExpress XtraReport. But in a situation you don't have the resource for that, you can easily use this code and maybe extend it. Introduction The ability to print in Silverlight 4 opens the door to creating better web-based applications than ever before. Silverlight now provides us with the opportunity to tie into a user's printer to create rich printouts of the very content they may be viewing. While setting up a PrintDocument is a rather simple ta...