none
How to preview rdlc in vs2010 RRS feed

  • Question

  • This report needs to be printed to pdf and downloaded to the client. There is no need to use report viewer control in application. How can I preview it from designer?
    Tuesday, August 30, 2011 12:37 PM

All replies

  • you have to add a reportviewer to an aspx page, you can use the sample below.  (no VS preview for rdlcs)

     Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load PrintFormReportViewer.LocalReport.ReportPath = reportPathAndFileName
     Dim reportDataSource = New ReportDataSource() With {.Name = "dtname", .Value = visit}

     Dim rp1 As ReportParameter
    rp1 = New ReportParameter("Title", "your title") localReport.SetParameters(rp1)

    localReport.DataSources.Add(reportDataSource)
    Response.Clear()
    Response.ContentType = "application/pdf"
    ''Enable the following to output as a file that gets downloaded as opposed to inline in the browser
    ''Response.AddHeader("content-disposition", "attachment; filename=Report.pdf")
    Response.BinaryWrite(PrintFormReportViewer.LocalReport.Render("PDF"))
    Response.Flush()
    Response.End()

    end sub

    Thursday, May 1, 2014 9:20 PM