Click here to Skip to main content
15,885,278 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 480K   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 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Algorithms.Topics.Algorithms.OnSetConnection</title>
<link rel="stylesheet" type="text/css" href="EasiReports.css">
</head>

<body>

 <h1>OnSetConnection Algorithms</h1>

 <p>You can only write one of these algorithms in each report.</p>
 <p>This algorithm is executed once at the  beginning of the print process.</p>
 <p>This algorithm has the following signature :</p>
 <pre class="Code">&nbsp;</pre>
 <pre class="Code">public void OnSetConnection( <a href="ms-its:EasiReportsReference.chm::/EasiReports.Algorithms.ReportProperties.html">ReportProperties</a> props, <a href="ms-its:EasiReportsReference.chm::/EasiReports.Algorithms.OnSetConnectionArgs.html">OnSetConnectionArgs</a> args )</pre>
 <pre class="Code">&nbsp;</pre>
 <p>Set or modify the <b>sConnection</b> property of the <b>report</b> property 
 of the <b>ReportProperties</b> argument to the required value :</p>
 <pre class="Code">&nbsp;</pre>
 <pre class="Code">props.report.sConnection += &quot;User ID=Admin;&quot;;</pre>
 <pre class="Code">&nbsp;</pre>
 <p>There is an example report, 
<a href="EasiReporter.Examples.14.htm">14.Parameters</a>, which shows how to 
 prompt the user for a User ID and Password using the
 <a href="SquareOneSoftware.Login.htm">SquareOneSoftware.Login</a> class and 
 this algorithm.</p>
 <p>The following properties of the <b>ReportProperties</b> parameter can be set 
 :</p>
 <table class="dtTABLE" cellSpacing="0">
   <tr vAlign="top">
     <th width="50%">Property</th>
     <th width="50%">Can be set</th>
   </tr>
   <tr vAlign="top">
     <td width="50%">
     <a href="ms-its:EasiReportsReference.chm::/EasiReports.Algorithms.ReportProperties.bLastRecord.html">bLastRecord</a></td>
     <td width="50%"><b>Yes</b></td>
   </tr>
   <tr vAlign="top">
     <td width="50%">
     <a href="ms-its:EasiReportsReference.chm::/EasiReports.Algorithms.ReportProperties.bStopPrint.html">
     bStopPrint</a></td>
     <td width="50%"><b>Yes</b></td>
   </tr>
   <tr vAlign="top">
     <td width="50%">
     <a href="ms-its:EasiReportsReference.chm::/EasiReports.Algorithms.ReportProperties.iCurrentMaxFooterLevel.html">
     iCurrentMaxFooterLevel</a></td>
     <td width="50%">Undefined</td>
   </tr>
   <tr vAlign="top">
     <td width="50%">
     <a href="ms-its:EasiReportsReference.chm::/EasiReports.Algorithms.ReportProperties.iCurrentMaxHeaderLevel.html">
     iCurrentMaxHeaderLevel</a></td>
     <td width="50%">Undefined</td>
   </tr>
   <tr vAlign="top">
     <td width="50%">
     <a href="ms-its:EasiReportsReference.chm::/EasiReports.Algorithms.ReportProperties.iMaxHeaderFooterLevel.html">
     iMaxHeaderFooterLevel</a></td>
     <td width="50%">No</td>
   </tr>
   <tr vAlign="top">
     <td width="50%">
     <a href="ms-its:EasiReportsReference.chm::/EasiReports.Algorithms.ReportProperties.report.html">
     report</a></td>
     <td width="50%">No</td>
   </tr>
   </table>
 <p>You can set the <b>Cancel</b> property of the <b>pea</b> property of the <b>
 OnSetConnectionArgs</b> parameter to true to cancel the whole print :</p>
 <pre class="Code">&nbsp;</pre>
 <pre class="Code">args.pea.Cancel = true;</pre>
 <pre class="Code">&nbsp;</pre>

</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