Example #1
0
        private void SetControlPositionInReport(Report.ReportQZ report, int groupID)
        {
            report.xrLabelMemo.Location     = GetLabelPoint("Memo", groupID);
            report.xrLabelPDate.Location    = GetLabelPoint("PDate", groupID);
            report.xrLabelDDate.Location    = GetLabelPoint("DDate", groupID);
            report.xrLabelUserName.Location = GetLabelPoint("UserName", groupID);
            report.xrLabelNamNimh.Location  = GetLabelPoint("NamNimh", groupID);
            report.xrLabelPID.Location      = GetLabelPoint("PID", groupID);
            report.xrLabelMDate.Location    = GetLabelPoint("MDate", groupID);
            report.xrLabelType.Location     = GetLabelPoint("Type", groupID);
            report.xrLabelTimes.Location    = GetLabelPoint("Times", groupID);
            report.xrLabelDuty.Location     = GetLabelPoint("Duty", groupID);
            report.xrLabelVID.Location      = GetLabelPoint("VID", groupID);

            report.xrLabelBirthday.Visible  = true;
            report.xrLabelBirthday.Location = GetLabelPoint("BDate", groupID);
            if (report.xrLabelBirthday.Location.X == 0 && report.xrLabelBirthday.Location.Y == 0)
            {
                report.xrLabelBirthday.Visible = false;
            }

            report.xrCustomerName.Visible  = true;
            report.xrCustomerName.Location = GetLabelPoint("CustomerName", groupID);
            if (report.xrCustomerName.Location.X == 0 && report.xrCustomerName.Location.Y == 0)
            {
                report.xrCustomerName.Visible = false;
            }

            report.xrCountry.Visible  = true;
            report.xrCountry.Location = GetLabelPoint("Country", groupID);
            if (report.xrCountry.Location.X == 0 && report.xrCountry.Location.Y == 0)
            {
                report.xrCountry.Visible = false;
            }


            visaEntities DataContextP = new visaEntities();

            TB_Position pageSize = DataContextP.TB_Position.FirstOrDefault(p => p.FName == "PageSize" && p.FGroupID == groupID);

            if (pageSize != null)
            {
                report.PageWidth  = Convert.ToInt32(pageSize.FX);
                report.PageHeight = Convert.ToInt32(pageSize.FY);
            }
            else
            {
                report.PageWidth  = 3000;
                report.PageHeight = 2100;
            }

            if (groupID == 1)
            {
                report.Font = new System.Drawing.Font("Times New Roman", 10);
            }
            else
            {
                report.Font = new System.Drawing.Font("Times New Roman", 12);
            }
        }
Example #2
0
        System.Drawing.Point GetLabelPoint(string LabelName, int GroupID)
        {
            int          X;
            int          Y;
            visaEntities visaORM = new visaEntities();

            TB_Position pModel = visaORM.TB_Position.OrderByDescending(p => p.FCreateDate).FirstOrDefault(p => p.FName == LabelName && p.FGroupID == GroupID);

            if (pModel == null)
            {
                MessageBox.Show(LabelName + "未设置位置数值");
                return(new System.Drawing.Point(0, 0));
            }
            else
            {
                X = (int)pModel.FX;
                Y = (int)pModel.FY;
                return(new System.Drawing.Point(X, Y));
            }
        }