使用数据集图像填充Crystal Report

时间:2012-07-30 23:50:31

标签: vb.net crystal-reports dataset vb.net-2010

我正在尝试使用数据集填充Crystal Report并尝试加载图像。我有一个字节数组的图像。我即将加载我的字符串数据就好了。我有一个带有数据表和一些列的数据集。 这是我的代码,但是我对这一行有疑问:

t.Columns.Add("Item", Type.GetType(System.Byte()))

具体System.Byte()

这是我的完整代码,是否有人知道我应该用该替换该行?

Private Function GetGmap(ByVal objGEOCode As String)
    Dim gmap As New CtpGglMap.Impl.StaticGMap
    Dim temp As New GMarker
    Dim temp2 As New GMarker
    Dim ArrTemp()
    ArrTemp = Split(objGEOCode, ",")
    gmap.Center = New GeoPointImpl(ArrTemp(0), ArrTemp(1))
    gmap.Zoom = 14


    gmap.Height = 159
    gmap.Width = 137
    gmap.Sensor = False
    '  GetDrivingDirectionFromGoogle("fishkill ,ny", "41.5442847, -73.8732391")

    temp.Point = New GeoPointImpl(ArrTemp(0), ArrTemp(1))
    temp.SetMap(gmap)

    'CREATE A BITMAP FROM THE MEMORY STREAM
    Return New System.Drawing.Bitmap(gmap.Fetch)



    Return True
End Function
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Dim ds As New DataSet1
    Dim t As DataTable = ds.Tables.Add("Items")
    t.Columns.Add("id", Type.GetType("System.String"))
    t.Columns.Add("Item", Type.GetType(System.Byte()))

    Dim r As DataRow

    r = t.NewRow()
    r("id") = "Test"
    r("Item") = GetGmap("41.5442847, -73.8732391")
    t.Rows.Add(r)


    Dim objRpt As New CrystalReport1
    objRpt.SetDataSource(ds.Tables(1))
    CrystalReportViewer1.ReportSource = objRpt
    CrystalReportViewer1.Refresh()

    CrystalReportViewer1.PrintReport()

End Sub

0 个答案:

没有答案