protected override void ReceiveBar_Changed(object sender, EventArgs e)
        {
            var bar = (ProgressBar)sender;

            bar.Position = 0;
            if (report.RowCount > 0)
            {
                if (report.GetCurrentColumnValue("ReceiveStatus").ToString() != "")
                {
                    byte status = (byte)report.GetCurrentColumnValue("ReceiveStatus");

                    bar.Position = status;
                }
            }
        }
        protected override void xrPictureBox2_BeforePrint(object sender, PrintEventArgs e)
        {
            int?status = (int?)report.GetCurrentColumnValue("EmpStatus");
            var Pic    = (XRPictureBox)sender;
            var root   = AppDomain.CurrentDomain.BaseDirectory;

            switch (status)
            {
            case 12:
                Pic.Image = new Bitmap(root + "Content\\Icons\\12.png");

                break;

            case 0:
                Pic.Image = new Bitmap(root + "Content\\Icons\\0.png");
                break;

            case 1:
                Pic.Image = new Bitmap(root + "Content\\Icons\\1.png");
                break;

            case 2:
                Pic.Image = new Bitmap(root + "Content\\Icons\\2.png");
                break;

            default:

                Pic.Visible = false;
                break;
            }
        }
        void subreport_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            XRSubreport subreport  = sender as XRSubreport;
            XtraReport  mainReport = subreport.Report as XtraReport;

            //Obtain the current CustomerID value for filtering the detail report
            String currentCustID = mainReport.GetCurrentColumnValue("CustomerID").ToString();

            subreport.ReportSource.Parameters["custID"].Value = currentCustID;
        }
Esempio n. 4
0
        /// <summary>
        /// Fixes RTL alignment direction for the given cells in the given report
        /// </summary>
        /// <param name="report">The report to fix its RTL direction alignment</param>
        /// <param name="cells">Cells to intercept their Text proeprty for a possible RTL fix</param>
        private static void MakeCellsRightToLeft(XtraReport report, IEnumerable <XRLabel> cells)
        {
            foreach (var cell in cells)
            {
                // Searching for cells that have a binding on their Text property
                var binding = cell.DataBindings.FirstOrDefault(x => x.PropertyName == "Text");

                if (binding != null)
                {
                    // In order to be able to unregister from the event we have to have
                    // a reference to the handler
                    PrintEventHandler beforePrintDelegate = null;

                    beforePrintDelegate = (_s, _e) =>
                    {
                        var value = report.GetCurrentColumnValue(binding.DataMember);

                        if (report.Parameters.Cast <Parameter>().Any(x => x.Name == binding.DataMember))
                        {
                            // a parameter is bound to this control
                            cell.Text = FixRTL(cell.Text);
                        }
                        else
                        {
                            // Examine the data type of the obtained value if it's not string
                            // we unregister from the BeforePrint event not to get future notifications
                            if (value is string)
                            {
                                // Adds a Right-To-Left MARK (U+200F) to the end of the string
                                (_s as XRLabel).Text = FixRTL(value.ToString());
                            }
                            else
                            {
                                // Unregisters from the BeforePrint
                                cell.BeforePrint -= beforePrintDelegate;
                            }
                        }
                    };

                    // Registering to the BeforePrint event to intercept the string values
                    cell.BeforePrint += beforePrintDelegate;
                }
                else
                {
                    // If the cell has no binding to any source so just add RLM character
                    // to the end of its Text property
                    cell.Text = FixRTL(cell.Text);
                }
            }
        }
        /// <summary>
        /// Fixes RTL alignment direction for the given cells in the given report
        /// </summary>
        /// <param name="report">The report to fix its RTL direction alignment</param>
        /// <param name="cells">Cells to intercept their Text proeprty for a possible RTL fix</param>
        private static void MakeCellsRightToLeft(XtraReport report, IEnumerable<XRLabel> cells)
        {
            foreach (var cell in cells)
            {
                // Searching for cells that have a binding on their Text property
                var binding = cell.DataBindings.FirstOrDefault(x => x.PropertyName == "Text");

                if (binding != null)
                {
                    // In order to be able to unregister from the event we have to have
                    // a reference to the handler
                    PrintEventHandler beforePrintDelegate = null;

                    beforePrintDelegate = (_s, _e) =>
                    {
                        var value = report.GetCurrentColumnValue(binding.DataMember);

                        if (report.Parameters.Cast<Parameter>().Any(x => x.Name == binding.DataMember))
                        {
                            // a parameter is bound to this control
                            cell.Text = FixRTL(cell.Text);
                        }
                        else
                        {
                            // Examine the data type of the obtained value if it's not string
                            // we unregister from the BeforePrint event not to get future notifications
                            if (value is string)
                            {
                                // Adds a Right-To-Left MARK (U+200F) to the end of the string
                                (_s as XRLabel).Text = FixRTL(value.ToString());
                            }
                            else
                            {
                                // Unregisters from the BeforePrint
                                cell.BeforePrint -= beforePrintDelegate;
                            }
                        }
                    };

                    // Registering to the BeforePrint event to intercept the string values
                    cell.BeforePrint += beforePrintDelegate;
                }
                else
                {
                    // If the cell has no binding to any source so just add RLM character
                    // to the end of its Text property
                    cell.Text = FixRTL(cell.Text);
                }
            }
        }