Click here to Skip to main content
15,896,429 members
Articles / Web Development / ASP.NET

Persian Calendar with Tray Icon

Rate me:
Please Sign up or sign in to vote.
3.71/5 (16 votes)
12 Mar 2012CPOL2 min read 71.3K   2.4K   27  
A Persian calendar that shows a tray icon
��using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using CrystalDecisions.CrystalReports.Engine;





namespace mytray

{

    public partial class Form_print : Form

    {

        public void Init_Report_all(DataSet dset,string date1,string date2, bool DOneOnly)

        {

            this.CrystalReport_taskall1.SetDataSource(dset);

            ///////filtering start

            string[] ar = date1.Split('/');



            string strFilter = "";



            if(ar[0].Trim()!="")         //strFilter= "{Tasks.Date}>=DateTime ("+ar[0]+","+ ar[1]+","+ ar[2]+", 00, 00, 00)" ;//1387/2/5'";

            strFilter = "{Tasks.Date}>='"+date1+"'";



            ar = date2.Split('/');



            if (strFilter != "" && ar[0]!="")  strFilter += " AND ";

            if (ar[0].Trim() != "") //strFilter += "{Tasks.Date}<=DateTime (" + ar[0] + "," + ar[1] + "," + ar[2] + ", 00, 00, 00)";//1387/2/5'";

                strFilter += "{Tasks.Date}<='" + date2 + "'";



            if (strFilter != "" && DOneOnly == true) strFilter += " AND ";

            if (DOneOnly == true)  strFilter += " {Tasks.Done} = False";// +filter_date + "'";

            if(strFilter!="")      CrystalReport_taskall1.RecordSelectionFormula = strFilter;

            /////////filtering end////////////////////////////////

            TextObject obtxt2 = (TextObject)CrystalReport_taskall1.Section3.ReportObjects["Text6"];

            if (DOneOnly == false) obtxt2.Text+= " � F' *E'E";

            if (date1 != "") obtxt2.Text += "'2 *'1�.";

            obtxt2 = (TextObject)CrystalReport_taskall1.Section3.ReportObjects["txt_date1"];

            if (date1 != "") obtxt2.Text =date1;

            if (date2 != "") obtxt2.Text += "*' *'1�.  ";

            obtxt2 = (TextObject)CrystalReport_taskall1.Section3.ReportObjects["txt_date2"];

            if (date2 != "") obtxt2.Text = date2;

            

            crystalReportViewer1.ReportSource = CrystalReport_taskall1;

        }

        public void Init_Report(DataSet dset,string dayname,string filter_date,bool DOneOnly)

        {

        

            this.CrystalReport_task1.SetDataSource(dset);

            crystalReportViewer1.ReportSource = CrystalReport_task1;

            string[] ar = filter_date.Split('/');



          //  FieldObject ob = (FieldObject)CrystalReport_task1.Section3.ReportObjects["Date1"];

           // CrystalReport_task1.RecordSelectionFormula = "{Tasks.Date} =DateTime (" + ar[0] + "," + ar[1] + "," + ar[2] + ", 00, 00, 00)";//1387/2/5'";

            CrystalReport_task1.RecordSelectionFormula = "{Tasks.Date} ='"+filter_date+"'";//1387/2/5'";

            if (DOneOnly == true)

                CrystalReport_task1.RecordSelectionFormula += " AND {Tasks.Done} = False";// +filter_date + "'";



            TextObject obtxt = (TextObject)CrystalReport_task1.Section3.ReportObjects["txt_date"];

            

            obtxt.Text =filter_date;

            TextObject obtxt2 = (TextObject)CrystalReport_task1.Section3.ReportObjects["txt_dayname"];

            obtxt2.Text =dayname;



                

            //ob.FieldFormat.

        }

            public Form_print()

        {

            InitializeComponent();

             }



            private void CrystalReport_taskall1_InitReport(object sender, EventArgs e)

            {



            }

    }

}

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
Engineer neyshabur azad univeristy
Iran (Islamic Republic of) Iran (Islamic Republic of)
I had worked as programmer,project manager,web developer for more than 3 years, and have worked on programming personaly for more than 10 years.
I have worked in university as a teacher for 8 years.
my favorite langueges are : VC++,C#,ASP.NET,PHP

Comments and Discussions