Click here to Skip to main content
15,891,529 members
Articles / Programming Languages / C#

EasiReports

Rate me:
Please Sign up or sign in to vote.
4.87/5 (64 votes)
13 Feb 2006CPOL6 min read 481.3K   9.7K   219  
A library to add reports to your application.
<html>

<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>EasiReports.Walkthrough.06</title>
<link rel="stylesheet" type="text/css" href="EasiReports.css">
</head>

<body>

 <h1>EasiReports Walkthrough 06</h1>
 <h2>06. Initialise a Report object.</h2>
	<p>You will need and OleDb connection string for this step, to specify your 
	database. It should look something like this :</p>
	<ul>
		<li>Microsoft Access database ( jet database engine ) :</li>
	</ul>
	<pre class="Code">&nbsp;</pre>
	<pre class="Code">Provider=Microsoft.Jet.OLEDB.4.0;</pre>
	<pre class="Code">Data Source=C:\Data\Northwind.mdb;</pre>
	<pre class="Code">&nbsp;</pre>
	<ul>
		<li>SQLServer database :</li>
	</ul>
	<pre class="Code">&nbsp;</pre>
	<pre class="Code">Provider=SQLOLEDB;</pre>
	<pre class="Code">Integrated Security=SSPI;</pre>
	<pre class="Code">Data Source=<b>&lt;SQLServer machine&gt;</b>;</pre>
	<pre class="Code">Initial Catalog=Northwind;</pre>
	<pre class="Code">&nbsp;</pre>
	<ul>
		<li>Oracle database :</li>
	</ul>
	<pre class="Code">&nbsp;</pre>
	<pre class="Code">Provider=OraOLEDB.Oracle.1;</pre>
	<pre class="Code">Data Source=<b>&lt;Oracle instance&gt;</b>;</pre>
	<pre class="Code">User ID=scott;</pre>
	<pre class="Code">Password=tiger;</pre>
	<pre class="Code">&nbsp;</pre>
	<p><b>NOTE :</b> You can build a connection string using EasiReporter. 
	Select the &quot;Database&quot; menu, and go to &quot;Connection...&quot;. Press the &quot;Create 
	Connection...&quot; button, and use the datalink dialog to specify your 
	connection. Clicking &quot;OK&quot; will bring you back to the &quot;Database Connection&quot; 
	dialog, and your connection string will be shown in the text box.</p>
	<p>When you have your connection string, add the following to your form's 
	constructor, just after the code from the previous step :</p>
	<pre class="Code">&nbsp;</pre>
	<pre class="Code">string connection = &quot;<b>Your connection string</b>&quot;;</pre>
<pre class="Code">&nbsp;</pre>
	<pre class="Code">
CMetadata metadata = new CMetadata();
metadata.Interrogate( connection );</pre>
<pre class="Code">&nbsp;</pre>
	<pre class="Code">
EasiReport report = new EasiReport( connection, metadata );</pre>
	<pre class="Code">&nbsp;</pre>
	<pre class="Code">ReportControl.SetReport( report );</pre>
	<pre class="Code">&nbsp;</pre>
	<p>You can now test your application. When you run it, you should see the 
	EasiReports Design View, with bands for the default sections.</p>
	<p>&nbsp;</p>

</body>

</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United Kingdom United Kingdom
I discovered C# and .NET 1.0 Beta 1 in late 2000 and loved them immediately.
I have been writing software professionally in C# ever since

In real life, I have spent 3 years travelling abroad,
I have held a UK Private Pilots Licence for 20 years,
and I am a PADI Divemaster.

I now live near idyllic Bournemouth in England.

I can work 'virtually' anywhere!

Comments and Discussions