I finally had the opportunity to take the Backbase Community Edition for a spin - and boy it rocks! After a couple of hours working with this I finally figured out how to make this AJAX framework to work in an ASP.NET web project. One of the usual stuff that we do in web applications is form submission. So it wasnt a surpise to find out that Backbase has its own way of handling forms, which is really incompatible with ASP.NET. Backbase is pure HTML and that could be a curse or a blessing. To test this facility, I created a new HTML form and wrote the following in the body:
<xmp b:backbase="true">
<form name="form1"
method="post"
action="reponse.ashx"
b:destination="id('destination')"
b:mode="replace">
User:<input type="text" name="user" />
<b:button b:action="submit" b:target="ancestor::form[1]">Send</b:button>
</form>
<div id="destination" />
</xmp>
The object of this exercise was simple. Enter the name of the user on the textbox and upon clicking the submit button, the name of the user should appear in place of <div id="destination"/> tag. Did it work? Yes it did, even before I could bat an eyelash.
the next update of the ClassicReports for .NET will include a new databound ClassicReport control so you wont have to write those event handlers unless really necessary. you will be able to edit the report at design time by clicking the small button that appears when the Template property has focus on the PropertyGrid. implementing the UITypeEditor was as simple as dropping the ReportDesigner in a form.
i was flipflopping on whether to use BindingSource or object as the type for the DataSource property. i finally chose the latter which seems to be the norm. the UITypeEditor for the DataSource property will have to wait a little longer, maybe a week or so depending on my free time ofcourse.
i also decided to make public the Document property which you will now use to pass to the Preview control or PrinterService. (i will also be making available a PDFService and XPSService soon) the Document object contains the collection of Pages which the ReportComposer populates.
Here's how to use the new control programmatically.
ClassicReport report = new ClassicReport();
report.Template = GetTemplate();
report.DataSource = GetData();
report.Execute();
PrinterService printer = new PrinterService(report.Document);
printer.PrintAll();