Error on binding Crystal report

T

Tumurbaatar S.

It's my first project using the Crystal report.
I created a report with the report designer
and linked it to a web form as:
1. put CrystalReportViewer in my page (its ID: Viewer).
2. put ReportDocument component from Toolbox | Components (its Name: Report)
and specified my existing report class (myproject.import.reports.shiporder).
3. in DataBinding of above viewer, I choosed Simple binding and selected
my report.
4. on Page_Load event handler I put "Viewer.DataBind();"

My report's data source is SQL stored procedure and it takes 1 parameter.
I thought that on browsing my report page, it will ask for parameter value.
I don't know how, maybe using JavaScript promt or something else.
But my page fails on "Viewer.DataBind();":

Server Error in '/myproject' Application.

Specified argument was out of the range of valid values. Parameter name:
value
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument
was out of the range of valid values. Parameter name: value

Source Error:

Line 16: <uc1:menu id="Menu" runat="server"></uc1:menu>
Line 17: <p><asp:label id="ErrorLbl" runat="server" forecolor="Red"
enableviewstate="False"></asp:label></p>
Line 18: <cr:crystalreportviewer id="Viewer" runat="server"
width="350px" height="50px" accesskey="<%# Report %>" reportsource="<%#
Report %>">
Line 19: </cr:crystalreportviewer>
Line 20: </form>

Source File: ...\myproject\web\import\shiporder.aspx Line: 18

Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of
valid values.
Parameter name: value]
System.Web.UI.WebControls.WebControl.set_AccessKey(String value) +96
ASP.shiporder_aspx.__DataBindViewer(Object sender, EventArgs e) in
....\myproject\web\import\shiporder.aspx:18
System.Web.UI.Control.OnDataBinding(EventArgs e) +66
System.Web.UI.Control.DataBind() +26
myproject.import.shiporder.Page_Load(Object sender, EventArgs e) in
....\myproject\web\import\shiporder.aspx.cs:61
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


What am I doing wrong?
I didn't add any behind code except "Viewer.DataBind();" as it was noted in
the online help.
I think that a database connection information is included within report
file and I have not
to supply connection/dataset at run-time.

Thank you!
P.S. ASP.NET 1.1 & VS2003
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top