Pleaseeeeee Help -- Bind ReportSource to CrystalReportViewer (VS.net2003 C# - Crystal Reports)

I need to bind a reportsource (already created .rpt), to a CrystalReportViewer. Programs:(VS.net2003 C# - Crystal Reports)
I have already read and followed the msdn instructions, but I think I am just in a panic.  I cannot seem to make this work.  
I started a new web project by using Asp.Net.WebApplication.  I now have forms Webform1.aspx and it's partner .cs.  I have added "Projects.rpt" to the project.  Webform1 now has the CrystalReportViewer, and I used the drag and drop for the oracleConnection.  How do I bind the Projects.rpt to the viewer?

The error I get is this:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1010: Newline in constant

Source Error:

 

Line 12:       <body MS_POSITIONING="GridLayout">
Line 13:             <form id="Form1" method="post" runat="server">
Line 14:                   <CR:CRYSTALREPORTVIEWER id="CrystalReportViewer1" style="Z-INDEX: 101; LEFT: 80px; POSITION: absolute; TOP: 64px"
Line 15:                         runat="server" Height="1089px" Width="1030px" ReportSource='<%# C:\\Inetpub\\wwwroot\\NOV30_IMPACT\\Projects.rpt" %>' HasRefreshButton="True">
Line 16:                   </CR:CRYSTALREPORTVIEWER></form>
 

Source File: c:\inetpub\wwwroot\NOV30_IMPACT\WebForm1.aspx    Line: 14

=======================
It looks to me like I have the databinding language wrong.  I could really use some help here.  I am in a real bind! (No pun intended)
NeedInputAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wimthepimscakeCommented:
Hi NeedInput,

I think ReportSource='<%# C:\\Inetpub\\wwwroot\\NOV30_IMPACT\\Projects.rpt" %>'
should be ReportSource="C:\Inetpub\wwwroot\NOV30_IMPACT\Projects.rpt"

Wimthepimscake
0
TheAvengerCommented:
I would say:

ReportSource=@"C:\Inetpub\wwwroot\NOV30_IMPACT\Projects.rpt"

or

ReportSource="C:\\Inetpub\\wwwroot\\NOV30_IMPACT\\Projects.rpt"

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wimthepimscakeCommented:
if it is in the html/asp.net markup you have to use ReportSource="C:\Inetpub\wwwroot\NOV30_IMPACT\Projects.rpt"
if it is in C# syntax theAvenger is right

Wim
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

NeedInputAuthor Commented:
I tried the Avenger's suggestion to use: CrystalReportViewer1.ReportSource = @"C:\Inetpub\wwwroot\NOV30_IMPACT\Projects.rpt";

This at least got a different error.  Now the error is about the logon.  I have the logon listed in the "InitializeComponent" section, so maybe I have put the reportsource in the wrong place.  I put the report source in "private void Page_Load".  I have the connection that requires the logon associated with the report viewer.  Should I have put the reportsource somewhere else?
0
TheAvengerCommented:
No, it's not a problem of the place where you set the report source. What kind of logon does it require? Is it for the database? If so, the report cannot take the needed data because of different reasons. The most probable problem is that the ASPNET account (under which the IIS is running) does not have permissions on the database server
0
NeedInputAuthor Commented:
I made sure the properties under IIS for this folder were shared and had read and write permissions.  However, I still get an error.  In moving the report source to be after the passwords, I no longer get the logon error, but get an error that page will not load.  This is the code.  Maybe in seeing the whole thing, you might see what I am not seeing.

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Oracle.DataAccess.Client;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.Web;
using CrystalDecisions.CrystalReports;
using CrystalDecisions.Web.Services.Enterprise;
using CrystalDecisions.ReportSource;


namespace NOV30_IMPACT
{

      public class WebForm1 : System.Web.UI.Page
      {
            protected System.Data.OracleClient.OracleConnection oracleConnection1;
            protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
            #region Web Form Designer generated code
            override protected void OnInit(EventArgs e)
            {
                  InitializeComponent();                  
                  base.OnInit(e);                  
                  DataBind();
                  this.CrystalReportViewer1.Visible = true;
                  this.CrystalReportViewer1.ReportSource= @"C:\Inetpub\wwwroot\NOV30_IMPACT\Projects.rpt";
            }
            
            private void InitializeComponent()
            {    
                  this.oracleConnection1 = new System.Data.OracleClient.OracleConnection();
                  //
                  // oracleConnection1
                  //
                  this.oracleConnection1.ConnectionString = "user id=user1;data source=ORACLEFILES;password=guest";
                  //      this.Load += new System.EventHandler(this.Page_Load);
                  this.CrystalReportViewer1.Visible = true;
                  this.CrystalReportViewer1.ReportSource = @"C:\Inetpub\wwwroot\NOV30_IMPACT\Projects.rpt";
            }
            #endregion
      }
}
0
TheAvengerCommented:
It's a problem in the database you are using (oracle if I see correctly), not in the folders. You should add rights for the ASPNET user in the database and all tables, stored procedures and other db objects taht are needed for the report.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.