This project has moved and is read-only. For the latest updates, please go here.

URL and Report Generation

Nov 15, 2012 at 3:04 PM

Whenever I try to generate a URL on a report table I get no alteration to that column, it is not a URL as expected, the following is an example of code I use:

    Public Sub Main()

 

        Dim report As New Report(CreateTestDataTable().ToReportSource(), New ExcelReportWriter())
        Dim urlTemplate As String = "http://www.google.com/search?q={0}"
        Dim mapUrl As Func(Of DataRow, String) = Function(dr) String.Format(urlTemplate, dr("Column B").ToString)
        report.DataFields("Column B").Url(Of DataRow)(mapUrl)
        Dim outputFile As String = "out.xlsx"

        Using fs As New FileStream(outputFile, FileMode.Create)

            report.WriteReport(fs)

        End Using
        Process.Start(outputFile)

 

    End Sub

    Private Function CreateTestDataTable() As DataTable
        Dim dt As New DataTable()
        dt.Columns.Add("Column A")
        dt.Columns.Add("Column B")
        dt.Rows.Add("One fish", "Two fish")
        dt.Rows.Add("Red fish", "Blue fish")
        Return dt
    End Function

Nov 19, 2012 at 4:00 PM

Still not working for me. Any suggestions?

I used this as an example for a command application, but when i use it as a web application i get the same issue of data rows not getting the url.