Rookie CR - .NET web form question 
Author Message
 Rookie CR - .NET web form question

I'm trying to convert the CR ADO.NET example from C## to VB .NET, and
the problem I keep having is that Visual Studio is telling me that
"CrystalReportViewer1" name is not declared.  Following is my code:

Imports System.Data.OleDb

Public Class WebForm1
    Inherits System.Web.UI.Page

    Public oRpt As CrystalReport1 = New CrystalReport1()
    Public objDataset As Dataset1 = New Dataset1()

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.De{*filter*}StepThrough()> Private Sub
InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init

        InitializeComponent()
        Dim oleConn As OleDbConnection = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\!crap\nv3.mdb")
        Dim dataAdapter As OleDbDataAdapter = New
OleDbDataAdapter("SELECT * FROM LendProfile", oleConn)
        dataAdapter.Fill(objDataset, "LendProfile")

        oRpt.SetDataSource(objDataset)

        CrystalReportViewer1.ReportSource = oRpt

    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here

    End Sub

End Class



Mon, 25 Jul 2005 08:58:54 GMT  
 Rookie CR - .NET web form question
"CrystalReportViewer1" name is not declared means you don't have a
declaration statement. Look in InitializeComponent()  for something like:

Dim CrystalReportViewer1=new CrystalReportViewer1()

If you don't find it then add a statement that declares and creates the
Report Viewer.



Quote:
> I'm trying to convert the CR ADO.NET example from C## to VB .NET, and
> the problem I keep having is that Visual Studio is telling me that
> "CrystalReportViewer1" name is not declared.  Following is my code:

> Imports System.Data.OleDb

> Public Class WebForm1
>     Inherits System.Web.UI.Page

>     Public oRpt As CrystalReport1 = New CrystalReport1()
>     Public objDataset As Dataset1 = New Dataset1()

> #Region " Web Form Designer Generated Code "

>     'This call is required by the Web Form Designer.
>     <System.Diagnostics.De{*filter*}StepThrough()> Private Sub
> InitializeComponent()

>     End Sub

>     Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Init

>         InitializeComponent()
>         Dim oleConn As OleDbConnection = New
> OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\!crap\nv3.mdb")
>         Dim dataAdapter As OleDbDataAdapter = New
> OleDbDataAdapter("SELECT * FROM LendProfile", oleConn)
>         dataAdapter.Fill(objDataset, "LendProfile")

>         oRpt.SetDataSource(objDataset)

>         CrystalReportViewer1.ReportSource = oRpt

>     End Sub

> #End Region

>     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>         'Put user code to initialize the page here

>     End Sub

> End Class



Tue, 26 Jul 2005 00:35:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. newbie vb.net web forms questions

2. Question about .net graphics on web form

3. JPEG from web or harddisc in .net CR 9

4. CR.NET Web Viewer takes too long to display report

5. VB.NET with ASP.NET web forms

6. Find good book about using CR.NET with VS.NET and .NET Framework

7. VS.Net + Cr.Net and VB.Net

8. CR 8.5 and CR from VS.Net package

9. Simple question - CR for .NET

10. Picture in CR for VS.NET - very simple question

11. CR .Net or CR 9 Developer

12. vb.net rookie problem

 

 
Powered by phpBB® Forum Software