Welcome to the Dark Side: Using XtraReports in Innovative Ways


ReportsIn a couple of weeks, Julian M Bucknall and I will be showing how to use DevExpress XtraReports by thinking outside the box. In a live webinar, we will create a report based on some POCO collections as well as a web service. Then we will take a look at how to bind different reports to create a final output including page numbering.  There are a number of ways to display reports depending on your project type, so it would only be fair to show off all the options.

Sometimes a data-bound report doesn’t quite fit the requirements, what should you do in that scenario?  How about pushing your data out to a Microsoft Word template? See how easy that is with the XtraRichEditControl and a couple of lines of code, and of course no demonstration would be complete without a look at SnapReporting.

Why not Join Julian and I for an hour of fun and fact finding, just click on the link below and register your details.

http://dxpr.es/1oVhYQp

100% DX – XtraReports : bye bye Crystal, sorry ActiveReports


What’s the first thing that comes to your mind when I mention reporting? Crystal? ActiveReports? I have used these and others on numerous projects, but then I learnt about Developer Express XtraReports, lets see if XtraReports can make it into the 100% DX range…

For a full run down on all the cool things you can achieve, check out the Developer Express web site, this post is about filling a need, quickly.

As part of the RetailOne Connect system, we needed to print a purchase order, nothing complex, just a nice looking report that can be updated from time to time. It was important to be able to export as a pdf, and generate the document quickly.

The report designer was just as friendly as expected, with a drag drop approach for fields, or a nice selection of other tools available in the toolbox,

Creating bands is a simple right click, inserting sub reports just as simple.

In the case of R1, I didn’t need any scripting or code behind, but I couldn’t help having a play first.

What really surprised me with the ease of implementing in the code:

A complete preview version of the order could be generated with as little as:

Dim report As PurchaseOrder = New PurchaseOrder()
report.DataSource = db.OrderSummaries.Where(Function(p) p.OrderID = OrderID)
report.ShowPreview()

The preview window has an amazing amount of options available, page layouts, colours, watermarks, export to PDF, JPG — you name it !

And a quick send order as PDF via email client was a matter of:

Create PDF from report:
Dim path As String = GetTempOrderPath()
Dim report As PurchaseOrder = New PurchaseOrder()
report.DataSource = db.OrderSummaries.Where(Function(p) p.OrderID = OrderID)
report.ExportToPdf(path)

Create Email with attachment:
Dim mail As SendFileTo.MAPI = New SendFileTo.MAPI
mail.AddAttachment(path)
mail.AddRecipientTo(Supplier.Contact, Supplier.Email)
mail.SendMailPopup(String.Format("Purchase Order {0}", OrderNumber), "Please find attached purchase order.")

For me there is no choice now, I will be sticking with XtraReports in all our projects. When I do a more complex layout or code behind I will do another post and report my findings.

My only complaint is that they don’t offer a version for Objective-C …. maybe in the future?