{"id":447,"date":"2008-01-04T18:24:34","date_gmt":"2008-01-05T01:24:34","guid":{"rendered":"http:\/\/members.crystalreportsbook.com\/crystal-reports-xi\/312-using-strongly-typed-reports-with-the-viewer\/"},"modified":"2008-01-04T18:25:56","modified_gmt":"2008-01-05T01:25:56","slug":"312-using-strongly-typed-reports-with-the-viewer","status":"publish","type":"post","link":"http:\/\/www.crystalreportsonlinetraining.com\/training\/312-using-strongly-typed-reports-with-the-viewer\/","title":{"rendered":"3.13 Using Strongly-Typed Reports with the Viewer"},"content":{"rendered":"<h3>Using Strongly-Typed Reports with the Viewer<\/h3>\n<p>Strongly-Typed reports are referenced by passing an instance of the report class to ReportSource property of the viewer. In this example I pass a new instance of the Employee_List class to the ReportSource property. For your application you would pass the class name of the report you want to display.<\/p>\n<p><code>Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<\/code><br \/>\n<code>CrystalReportViewer1.ReportSource = New Employee_List<\/code><br \/>\n<code>End Sub<\/code><br \/>\n<caution>When using Untyped or Strongly-Typed reports, don&#8217;t call the viewer&#8217;s DataBind() method. If you call DataBind() after setting the ReportSource property, the ReportSource value is reset and the report won&#8217;t display. I see this mistake a lot because people assume that calling the DataBind() method is a requirement for using the viewer. This isn&#8217;t the case at all. It&#8217;s only necessary if you set properties within the DataBindings dialog box. If you do need to call the DataBind() method, call it prior to setting the ReportSource property in code.<\/caution><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using Strongly-Typed Reports with the Viewer Strongly-Typed reports are referenced by passing an instance of the report class to ReportSource property of the viewer. In this example I pass a new instance of the Employee_List class to the ReportSource property. For your application you would pass the class name of the report you want to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,2],"tags":[],"class_list":["post-447","post","type-post","status-publish","format-standard","hentry","category-chapter-3-integrating-reports","category-crystal-reportsnet-2003","entry"],"_links":{"self":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/comments?post=447"}],"version-history":[{"count":0,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/447\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/media?parent=447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/categories?post=447"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/tags?post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}