473,396 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Crystal Report and Inline code

I'm trying to develop a crystal report page using inline code (no code behind
page).

Here is my code:

<%@ Page language="c#" %>
<%@ Register TagPrefix="cr" Namespace="CrystalDecisions.Web"
Assembly="CrystalDecisions.Web, Version=9.1.5000.0, Culture=neutral,
PublicKeyToken=652fbea5521e1541" %>

<HTML>
<HEAD>
<script language=CS runat=server>
private void Page_Load(object sender, System.EventArgs e)
{
CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1 = new
CrystalDecisions.Web.CrystalReportViewer();
crystal.Simple sreport = new Simple();
CrystalReportViewer1.ReportSource = sreport;
sreport.SetDatabaseLogon("Duncan","password");
}
</script>
<title>WebForm2</title>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server"><CR:CrystalReportViewer
id=CrystalReportViewer1 style="Z-INDEX: 101; LEFT: 6px; POSITION: absolute;
TOP: 5px" runat="server"></CR:CrystalReportViewer>
</form>
</body>
</HTML>

I'm not sure how to reference the namespaces, on a code behind page its:
using CrystalDecisions.Shared;
using System.Data.SqlClient;

I'm getting the following error: CS0246: The type or namespace name 'Simple'
could not be found (are you missing a using directive or an assembly
reference?)

Also I'm not sure how to instantiate the viewer, on a code behind page its:
protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
Where would I put this on the inline page?

Thanks for any help,

John
Mar 26 '06 #1
1 2389
Hi John,

It seems that crystal.Simple is strong type of

CrystalDecisions.CrystalReports.Engine.ReportDocum ent

You might also need namespace CrystalDecisions.ReportSource.

HTH

Elton Wang
"John" wrote:
I'm trying to develop a crystal report page using inline code (no code behind
page).

Here is my code:

<%@ Page language="c#" %>
<%@ Register TagPrefix="cr" Namespace="CrystalDecisions.Web"
Assembly="CrystalDecisions.Web, Version=9.1.5000.0, Culture=neutral,
PublicKeyToken=652fbea5521e1541" %>

<HTML>
<HEAD>
<script language=CS runat=server>
private void Page_Load(object sender, System.EventArgs e)
{
CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1 = new
CrystalDecisions.Web.CrystalReportViewer();
crystal.Simple sreport = new Simple();
CrystalReportViewer1.ReportSource = sreport;
sreport.SetDatabaseLogon("Duncan","password");
}
</script>
<title>WebForm2</title>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server"><CR:CrystalReportViewer
id=CrystalReportViewer1 style="Z-INDEX: 101; LEFT: 6px; POSITION: absolute;
TOP: 5px" runat="server"></CR:CrystalReportViewer>
</form>
</body>
</HTML>

I'm not sure how to reference the namespaces, on a code behind page its:
using CrystalDecisions.Shared;
using System.Data.SqlClient;

I'm getting the following error: CS0246: The type or namespace name 'Simple'
could not be found (are you missing a using directive or an assembly
reference?)

Also I'm not sure how to instantiate the viewer, on a code behind page its:
protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
Where would I put this on the inline page?

Thanks for any help,

John

Mar 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
0
by: Dr. Indera | last post by:
hello, i previously posted the questions below on several crystal reports newsgroups, including the one for the company that makes crystal reports, but never got an answer, so i'm hoping that...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
1
by: CBKowitz | last post by:
I have an intermittent problem, when viewing a crystal report. This problem only happens to some users and some report formats. When they try to view the report in Microsoft Word format the...
1
by: bthomas71chevy | last post by:
I have just setup a WebServer and all the applications work fine, but when every any of the applications try to generate a Crystal Report the page errors out. "File or assembly name...
0
by: emarvets | last post by:
I am working (unsuccessfully) with Crystal XI. I create a report and export it to pdf. It works fine when I set it to an attachment, but nothing appears to happen when I switch over to inline. ...
1
by: Tim_Mac | last post by:
hi, i am encountering a sporadic exception using crystal reports that is causing me grief, I can't 'handle' it... my code is loading a typed report, and loading a DataSet to it. unfortunately...
0
by: lrobo01 | last post by:
I'm having a problem with Crystal report.net with ASP.NET. The problem occurs when exporting the report. The report uses a discrete parameter with multiple values. When the report is loaded into...
0
by: lrobo01 | last post by:
I'm having a problem with Crystal report.net with ASP.NET. The problem occurs when exporting the report. The report uses a discrete parameter with multiple values. When the report is loaded into...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.