Click here to Skip to main content
15,916,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
if have assigned xsd file to rpt. now i have to set data source by code but its nor working. its showing blank report. i have written following code


VB
<pre lang="vb">
Dim reportdocument As New ReportDocument

        Dim query As New StringBuilder
        Dim ds As New DataSet
.ToString, conn)
           da.Fill(ds)

           reportdocument.Load(Server.MapPath(&quot;~/Vehreport.rpt&quot;))


           reportdocument.SetDataSource(ds)


           CrystalReportViewer1.ReportSource = reportdocument
           CrystalReportViewer1.DataBind()


    CrystalReportViewer1.RefreshReport()</pre>


data is coming in dataset ds but report is coming blank.is any thing missing?
Posted
Updated 22-May-14 19:31pm
v2

Try this, i have used it for rdlc & it works fine:


C#
ReportViewer1.Visible = true;
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("dsRatingReport", dsRatingReport.Tables(0)));
ReportViewer1.LocalReport.Refresh();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900