Error When using Crystal Reports: 'C' is not accessible in this context because it is 'Private'.

R

Richard

I keep getting this error and i dont know how 2 fix it. If someone knows
how, please tell me :D

Compilation Error
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: BC30389: 'C' is not accessible in this context
because it is 'Private'.

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: 16px; POSITION: absolute; TOP: 16px" runat="server" Width="966px"
Height="977px" ReportSource="<%# C:\Inetpub\wwwroot\personeel\World Sales
Report.rpt %>" SelectionFormula="{Customer.Last Year's Sales}>0">
Line 15: </cr:CrystalReportViewer>
Line 16: </form>
 
S

Steven Cheng[MSFT]

Hi Richard,

From your description, you encountered the
================
Compiler Error Message: BC30389: 'C' is not accessible in this context
because it is 'Private'.
================
compile error when try running the asp.net web page which has contained a
crystal report Viewser in it ,yes?

based on the checking in the Source you provided, I think the error is
likely due to the following setting in the page source:
=========================
<cr:CrystalReportViewer id=CrystalReportViewer1 style="Z-INDEX:
101; LEFT: 16px; POSITION: absolute; TOP: 16px" runat="server" Width="966px"
Height="977px" ReportSource="<%# C:\Inetpub\wwwroot\personeel\World Sales
Report.rpt %>" SelectionFormula="{Customer.Last Year's Sales}>0">
=========================

You set the absolute physical path of the report file on the server in the
<%# %> block , but you haven't used the quote "" to wrap the path , so when
complie the page, the asp.net will process it as a variable and get the
preceding error.
In addition, I recommend that you use the "Server.MapPath()" function to
get the physcial path of file from its virutal url path rather than
directly hard code the physical path in page source.
If you have any further questions, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

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

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top