I have been asked how to do these things if you are a VB programmer.


Well my very first comment you may have guessed already :o) Use the templates! – yes that’s right, some sweet soul has created templates for the VB side of things as well.


Back to my little example of a native report implementation, I’m not much of a VB programmer but let me see if I can pull this one off…

In VB CreateData would look like this:


Public Function CreateData(ByVal reportFilters As IReportFiltersV2, ByVal engine As IReportEngineV2) As System.Data.DataView Implements INativeReportV2.CreateData


    Dim instance As ISmallBusinessInstance = engine.SmallBusinessInstance

    Dim view As DataView = instance.CustomerAccounts.DataView

    Return View


End Function


And Create Design would look something like this:


Public Sub CreateDesign(ByVal iReportDesign As IReportDesignV2) Implements INativeReportV2.CreateDesign


    iReportDesign.ReportHeader.ReportTitle.Text = "Hello World Invoice list"

    Dim columns As IReportColumnsV2 = iReportDesign.ReportColumns

    columns.CreateReportColumn("CustomerName", "Customer Name", ReportColumnType.RowLabel, ReportColumnDataType.Text)

    columns.CreateReportColumn("FriendlyDocumentName", "Document", ReportColumnType.RowLabel, ReportColumnDataType.Text)

    columns.CreateReportColumn("SubTotalAmount", "Sub Total", ReportColumnType.Data, ReportColumnDataType.CurrencyWithoutSymbol)

    columns.CreateReportColumn("Balance", "Balance", ReportColumnType.Data, ReportColumnDataType.CurrencyWithoutSymbol)

    columns.CreateReportColumn("DueDate", "Due Date", ReportColumnType.Data, ReportColumnDataType.Date)


End Sub


Not too hard!