Solved

CS1026: ) expected

Posted on 2003-11-16
4
983 Views
Last Modified: 2010-05-18
Can somewhere help me figure this error out -- "CS1026: ) expected"? I have a Crystal Reports object withing my aspx page, pointed to a .rpt file.

Here's the line that is throwing the error:
<cr:CrystalReportViewer id="objCRViewer" runat="server" width="1050px" height="1088px" reportsource="<%# C:\Chart.rpt %>" displaytoolbar="False" borderstyle="Solid" borderwidth="1px"/>

Here's some of the code-behind for the page:
            protected CrystalDecisions.Web.CrystalReportViewer objCRViewer;
      
            private void Page_Load(object sender, System.EventArgs e)
            {
                  ReportDocument objReportDoc = new ReportDocument();

                  objReportDoc.Load(@"C:\Chart.rpt");
                  objCRViewer.ReportSource  = objReportDoc;
            
            }

Nothing to difficult, but it doesn't want to display. "Chart.rpt" is one of the samples that comes with VS.Net.

Thanks in advance
0
Comment
Question by:Junoti
4 Comments
 
LVL 6

Assisted Solution

by:DaniPro
DaniPro earned 83 total points
ID: 9762114
I think that you haven't close the tag
<cr:CrystalReportViewer id="objCRViewer" runat="server" width="1050px" height="1088px" reportsource="<%# C:\Chart.rpt %>" displaytoolbar="False" borderstyle="Solid" borderwidth="1px">
</cr:CrystalReportViewer>
0
 
LVL 10

Assisted Solution

by:smegghead
smegghead earned 83 total points
ID: 9762601
Hi,

What is the punctuation around c:\chart.rpt, why can't it just be

reportsource="c:\chart.rpt"

??

If you need to include an angle bracket within the xml, you have to use &lt; &gt;  for < >

HTH

Smg.
0
 
LVL 1

Accepted Solution

by:
darkxenn earned 84 total points
ID: 9766382
try throwing a @ in front of your "" for reportsource...

make it look like this
reportsource = @"<%# C:\Chart.rpt %>"

that should do it
-Xen
0
 
LVL 1

Author Comment

by:Junoti
ID: 9768014
I'll split the points with everyone for at least taking a stab. It turned out that I couldn't have two "ReportSource" assignments. There was one in the HTML and in the code-behind. I took the HTML version out, and left the code-behind version in, and voila. <shakes head> Stupid me...

Thanks everyone.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now