WinForms–End-User Report Designer Custom Report Storage (Coming in v2010 vol 2)

DevExpress Data Blog
29 November 2010

Coming in version 2010 volume 2 we’ve made it easier to save and load reports to any data source in the end-user report designer. In the following diagram I have created a new Open Dialog which loads the report definition from a dataset saved to an xml file:

Open

This kind of extension will allow you and your users to save reports to virtually any medium! A special class needs to be created that extends the CustomReportStorage class that has the following methods:

  1. bool CanSetData(string url) – Whether or not a particular url (or report) can be saved
  2. byte[] GetData(string url) – Get report data by url (or name)
  3. string GetNewUrl() – Load or open a report
  4. string[] GetStandardUrls(ITypeDescriptorContext context) – Whether or not we can specify a url (name) for sub reports
  5. bool GetStandardUrlsSupported(ITypeDescriptorContext context) – Available report url (name) for sub reports
  6. bool IsValidUrl(string url) – Whether or not a report url (name) is valid)
  7. void SetData(XtraReport report, string url) – Save a report by url (name)
  8. string SetNewData(XtraReport report, string defaultUrl) – Save a new report by url (name)

Here is the Save dialog box:

Save

The form I created is simply our grid and the populated dataset!

SaveDialog

I made a video walking through this example located here.

As always, if there are any comments and/or questions, feel free to get a hold of me!

Seth Juarez
Email: sethj@devexpress.com
Twitter: @SethJuarez

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.