Click here to Skip to main content
15,881,173 members
Articles / Web Development / HTML

ASP.NET Reports Starter Kits Porting from Windows to Linux (Race to Linux)

Rate me:
Please Sign up or sign in to vote.
3.30/5 (4 votes)
30 Sep 20055 min read 33.7K   19  
ASP.NET Reports Starter Kit Porting from Windows to Linux using Mainsoft's Grasshopper
<html><head><link rel=stylesheet href=style.css></head><body><div class=SourcePanel style='font-size:12'><pre style='background-color:white'>
<font color= "blue">using</font> System;
<font color= "blue">using</font> System.Data;
<font color= "blue">using</font> System.Configuration;
<font color= "blue">using</font> ASPNET.StarterKit.Reports.DataAccessLayer;
<font color= "blue">using</font> System.Collections;
<font color= "blue"></font>
<font color= "blue">namespace</font> ASPNET.StarterKit.Reports.Components
<font color= "blue"></font>{
<font color= "green">    //*********************************************************************</font>
<font color= "green">    //</font>
<font color= "green">    // SimpleReport Class</font>
<font color= "green">    //</font>
<font color= "green">    // The SimpleReport class is used to represent a data item for Simple Report </font>
<font color= "green">    // and is mainly used to retrieve data from the database.</font>
<font color= "green">    //</font>
<font color= "green">    //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">    public class</font> SimpleReport
<font color= "blue">    </font>{
<font color= "blue">        private </font>string _city;
<font color= "blue">        private </font>string _companyName;
<font color= "blue">        private </font>string _contactName;
<font color= "blue">        private </font>string _contactTitle;
<font color= "blue">        private </font>string _phone;
<font color= "blue"></font>
<font color= "blue">        public </font>string City
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _city; }
<font color= "blue">            set</font> { _city = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        public </font>string CompanyName
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _companyName; }
<font color= "blue">            set</font> { _companyName = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        public </font>string ContactName
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _contactName; }
<font color= "blue">            set</font> { _contactName = value; }
<font color= "blue">        </font>}
<font color= "blue">        </font>
<font color= "blue">        public </font>string ContactTitle
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _contactTitle; }
<font color= "blue">            set</font> { _contactTitle = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        public </font>string Phone
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _phone; }
<font color= "blue">            set</font> { _phone = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "green">        //*********************************************************************</font>
<font color= "green">        //</font>
<font color= "green">        // GetCustomerContacts method retrieves all the necessary customer contacts</font>
<font color= "green">        // information from the database and transforms the result to a SimpleReportCollection</font>
<font color= "green">        // custom colletion before returning it to the calling function</font>
<font color= "green">        //</font>
<font color= "green">        //*********************************************************************</font>
<font color= "blue">        </font>
<font color= "blue">        public </font>static SimpleReportCollection GetCustomerContacts()
<font color= "blue">        </font>{
<font color= "blue">            </font>DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetCustomerContacts");
<font color= "blue">            </font>SimpleReportCollection items = new SimpleReportCollection();
<font color= "blue"></font>
<font color= "blue">            </font>foreach(DataRow row in dsData.Tables[0].Rows)
<font color= "blue">            </font>{
<font color= "blue">                </font>SimpleReport item = new SimpleReport();
<font color= "blue">                </font>item.City = row["City"].ToString();
<font color= "blue">                </font>item.CompanyName = row["CompanyName"].ToString();
<font color= "blue">                </font>item.ContactName = row["ContactName"].ToString();
<font color= "blue">                </font>item.ContactTitle = row["ContactTitle"].ToString();
<font color= "blue">                </font>item.Phone = row["Phone"].ToString();
<font color= "blue">                </font>items.Add(item);
<font color= "blue">            </font>}
<font color= "blue">            return</font> items;
<font color= "blue">        </font>}    
<font color= "blue">    </font>}
<font color= "blue"></font>}
</pre>

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect
Australia Australia
"Impossible" + "'" + " " = "I'm Possible"

Started programming when i was a kid with 286 computers and Spectrum using BASIC from 1986. There was series of languages like pascal, c, c++, ada, algol, prolog, assembly, java, C#, VB.NET and so on. Then shifted my intrest in Architecture during past 5 years with Rational Suite and UML. Wrote some articles, i was member of month on some sites, top poster(i only answer) of week (actually weeks), won some books as prizes, rated 2nd in ASP.NET and ADO.NET in Australia.

There is simplicity in complexity

Comments and Discussions