Question : Telerik Reporting, Report Viewer

I am using Visual Studio 2008, VB, ASP.Net, with a 2008 SQL database.  I am using Telerik Reporting with a Telerik Report Viewer.  

The reports reside in a class library and the class library has been referenced to the web application.

I'd like to populate the viewer by catching an event from the .aspx page (such as a button-click.)  The report viewer shows the report with no problem if you place the report in the viewer's "REPORT" property in the properties box.  But I just cannot find the syntax to populate the viewer in the VB code-behind.

Here's the HTML:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="RptStudentListing.aspx.vb" Inherits="SCO.RptStudentListing" %>

<%@ Register assembly="Telerik.ReportViewer.WebForms, Version=3.2.9.1211, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" namespace="Telerik.ReportViewer.WebForms" tagprefix="telerik" %>

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

http://www.w3.org/1999/xhtml" >

    Untitled Page
   
   


   
   

       
   

   
   
            Report="SCOReports.rptFeesDue, SCOReports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
   

   



Now the vb code-behind:

Imports SCOReports
Imports System
Imports System.Web.UI
Imports Telerik.Reporting
Partial Public Class RptStudentListing
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        rvStudentListing.Visible = False
    End Sub

    Private Sub btnStudList_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnStudList.Click
        rvStudentListing.Visible = True

    End Sub


    Private Sub btnFeesDue_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFeesDue.Click
        rvStudentListing.Visible = True

    End Sub


    Private Sub ChooseReport(ByVal name As String)
        rvStudentListing.Report = SCOReports.rptFeesDue
    End Sub
End Class

This seems so easy, but I've spent a lot of time on it with no success.  Any thoughts would be appreciated.

Answer : Telerik Reporting, Report Viewer

Full code :

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title></title>

<META name="description" content="" />
<META name="keywords" content="" />
<META name="author" content="" />
<SCRIPT language="JavaScript">
var TlxPgNm='welcome';
</SCRIPT>
<script language=JavaScript> var U=0;L=1; // (U)nlocked & (L)ocked
function doIt(_v)
{
if(eval("document.bgcheck.c"+_v+".checked"))
{

if(_v==2){lock(3);lock(4);}
if(_v==3){lock(2);lock(4);}
if(_v==4){lock(2);lock(3);}
}
else
{

if(_v==2){unlock(3);unlock(4);}
if(_v==3){unlock(2);unlock(4);}
if(_v==4){unlock(2);unlock(3);}
}
}
function lock(_v)
{
eval("document.bgcheck.c"+_v+".disabled=true"); // IE thing
eval("document.bgcheck.h"+_v+".value=L");
eval("document.bgcheck.h"+_v+".name=''");
}
function unlock(_v)
{
eval("document.bgcheck.h"+_v+".name=document.bgcheck.h"+_v+".id");
eval("document.bgcheck.c"+_v+".disabled=false"); // IE thing
eval("document.bgcheck.h"+_v+".value=U");
}
function whipe(_v)
{
eval("document.bgcheck.c"+_v+".checked=false");
}

</script>


<link rel="stylesheet" href="xxxxxx.css" />
<style type="text/css">
-->
</style>
</head>
<!--Content Here -->
<body>


        <table width="600" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="C2C2C2">
        <form action="sales_script.php" name="sales" method="post" enctype="multipart/form-data">
<tr><td>
Basic Package<input type="checkbox" name="c4" id="chk" value="Basic Package" onclick="document.getElementById('showMeOnClick1').style.color="#777777";display=(this.checked)?'inline':'none'; doIt(4)" /><input type=hidden name=h4 value=0>
<div id="showMeOnClick11" style="display:none"> </td></tr>

<tr><td><p><em>This package includes the following:</em><br /></p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>

<!--When this checkbox above is checked, the fields below display, and the checkbox associated with package below grays out.  When unchecked, these fields hide and checkbox associated with package below is NOT grayed out.   The same goes for the next checkbox.-->

<div id="showMeOnClick1" style="display:none"> 
<p><strong>Enter your sizes:</strong><br />
  <input name="color1" type="text" value="" size="30"> 
  <input name="color2" type="text" value="" size="30"> 
</div>

</td>

</tr>


<tr><td>
Standard Package<input type="checkbox" name="c4" id="chk" value="standard Package" onclick="document.getElementById('showMeOnClick1').style.color="#777777";display=(this.checked)?'inline':'none'; doIt(4)" /><input type=hidden name=h4 value=0>
<div id="showMeOnClick11" style="display:none"> </td></tr>


<tr><td><p><em>This package includes the following:</em>><br /></p>
<ul>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
<!--When this checkbox above is checked, the fields below display -->

<div id="showMeOnClick1" style="display:none"> 
<p><strong>Enter size1" type="text" value="" size="30"> 
  <input name="size2" type="text" value="" size="30"> 
</div>

</td>

</tr>


</td>
</tr>
</table>   
        <table width="700" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="ffffff">
        <form action="bgcheck_script.php" method="post" enctype="multipart/form-data"> 
   <tr>
   <td colspan="2"><div align="center"><br /><input type="submit" name="Submit" value="Submit">
              <font color="#FFFFFF"><br>
              <br>
              </font><font color="#FFFFFF"> </font>
</div>  </td></tr>
            </form>
                        </table>
</body></html>
Random Solutions  
 
programming4us programming4us