in Search
     
Latest post 04-12-2007 9:50 PM by smash. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-15-2007 7:41 PM

    • smash
    • Top 25 Contributor
    • Joined on 11-28-2005
    • Davao City, Philippines
    • Posts 202
    • Points 2,290

    ClassicReports download

    ClassicReports for .NET v1.0 can now be downloaded here at DevPinoy.
    • Post Points: 5
  • 03-20-2007 12:06 AM In reply to

    • smash
    • Top 25 Contributor
    • Joined on 11-28-2005
    • Davao City, Philippines
    • Posts 202
    • Points 2,290

    Re: ClassicReports download

    I just uploaded an updated version of ClassicReports.  There was a bug in the Average Function which needed fixing. This was caught by the unit tests I just implemented.  I also made little adjustments to the API which was necessary so I can wrap the ReportComposer inside a class like so:

    namespace Reports
    {
    public interface IReport
    {
    	void Execute();		
    	ReportComposer Composer { get; }
    }
    
    public class SampleReport : IReport
    {
    	ReportComposer composer;
    	
    	public SampleReport()
    	{
    		string schema = Resource.GetSchema("sample.xml");
    		composer = new ReportComposer(schema);
    		composer.InitData += OnInitData;
    		composer.ReadData += OnReadData;
    	}
    		
    	public void Execute()
    	{
    		composer.Execute();
    	}
    		
    	public ReportComposer Composer
    	{
    		get { return composer; }
    	}
    		
    	void OnInitData(object sender, JasonJimenez.ClassicReport.ReportComposerEventArgs e)
    	{
    		e.Count = 50;
    	}
    
    	void OnReadData(object sender, JasonJimenez.ClassicReport.ReportComposerEventArgs e)
    	{
    		e.Value = "Hello, World!";
    	}
    }
    
    static class Resource
    {
    	static public string GetSchema(string name)
    	{
    		string source = "Reports."+name;
    		System.IO.Stream stream =
    			typeof(Resource).Assembly.GetManifestResourceStream(source);
    		System.IO.StreamReader reader= 	new System.IO.StreamReader(stream);
    		string schema = reader.ReadToEnd();
    		reader.Close();
    		stream.Close();
    		return schema;
    	}
    }
    		
    }
    
    
    • Post Points: 5
  • 03-27-2007 12:29 AM In reply to

    • smash
    • Top 25 Contributor
    • Joined on 11-28-2005
    • Davao City, Philippines
    • Posts 202
    • Points 2,290

    Re: ClassicReports download

    I just fixed an issue concerning calculated Fields located in a PageFooter band when there are more than one Detail band.  I also made some minor adjustments to the ReportComposer to simplify the coding for handling datasources whose record count is unknown, such us when the datasource is a IDataReader or IEnumerable.  The Field control now has an ArrayIndex property.  This is useful in situations where you want to read values from an array. 

    I have uploaded the fix including a sample project for handling IEnumerable datasources.  See screenshots below. 







    • Post Points: 5
  • 04-12-2007 9:50 PM In reply to

    • smash
    • Top 25 Contributor
    • Joined on 11-28-2005
    • Davao City, Philippines
    • Posts 202
    • Points 2,290

    Re: ClassicReports download

    i have posted the update which includes the ClassicReports control which i mentioned in my blog a while back.  Take it for a spin and I would certainly appreciate any feedback from you guys. 

     I have reworked the sample project to use the new databound control instead of the ReportComposer.  This update entailed some refactoring which should not have happened if I knew about NUnit when I started writing .NET apps.  :) 

    BTW, the zip download includes the Northwind access database which I used as datasource in one of the featured report.  I will be releasing the code for ClassicReports after another round of refactoring.  So stay tuned and enjoy the sample project...

    • Post Points: 5
Page 1 of 1 (4 items)