Use of reports in VB.NET

0

I have to change the reports from Crystal Report to PDFsharp & MigraDoc, the bad thing is that I can not find documentation regarding the use of queries. For example:

-> Crystal Report

    Protected Sub btnVerFichaDet_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnVerFichaDet.Click
    Dim ds As New DataSet
    Dim strSql As String = "Select * from " & tbLibro & " where cLibro_CodNumerico=" & Trim(txtLibro_CodNumerico.Text)
    Dim adp As New SqlDataAdapter(strSql, vConex_BDCapacitacion)
    adp.Fill(ds, "Reporte")
    ds.Dispose()
    Call ExportarReporte("RptFichaDetallada.rpt", "ReporteFicha", ds.Tables("Reporte"), "pdf")
End Sub

Sub ExportarReporte(ByVal nombreReporte As String, ByVal tituloReporte As String, ByVal MyDataTable As DataTable, ByVal strFile As String)

    Dim info As New ReportDocument
    Dim strNombre As String = ""

    Dim myData As DataTable
    myData = MyDataTable
    Try
        info.Load(Server.MapPath("~/Reportes/" & nombreReporte))
        strNombre = tituloReporte

        info.SetDataSource(myData)
        Select Case strFile
            Case "pdf"
                info.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, strNombre)
            Case "xls"
                info.ExportToHttpResponse(ExportFormatType.Excel, Response, True, strNombre)
        End Select
    Catch ex As Exception
        Exit Sub
    Finally
        info = Nothing
        myData = Nothing
    End Try
End Sub

How to move to PDFsharp & MigraDoc the same query to be visible in a PDF report ?. Or is there another way to make those queries appear in a pdf? Thanks

    
asked by FransMB 06.09.2018 в 09:47
source

0 answers