示例#1
0
        private void simpleButtonPreview_Click(object sender, EventArgs e)
        {
            Config.NewKeyValue("Operation", (sender as SimpleButton).Text);
            if (gvMain.SelectedRowsCount == 0)
            {
                return;
            }
            if (_data.DrTable["Report"].ToString() == string.Empty)
            {
                gcMain.ShowPrintPreview();
            }
            else
            {
                int[] oldIndex = gvMain.GetSelectedRows();
                int[] newIndex = oldIndex;
                if (gvMain.SortedColumns.Count > 0)
                {
                    for (int i = 0; i < oldIndex.Length; i++)
                    {
                        newIndex[i] = _data.DsData.Tables[0].Rows.IndexOf(gvMain.GetDataRow(oldIndex[i]));
                    }
                }

                BeforePrint bp = new BeforePrint(_data, newIndex);
                bp.ShowDialog();
            }
        }
示例#2
0
 private void simpleButtonPreview_Click(object sender, EventArgs e)
 {
     Config.NewKeyValue("Operation", (sender as SimpleButton).Text);
     if (_data.DrTable["Report"].ToString() == string.Empty)
     {
         gcDetail.ShowPrintPreview();
     }
     else
     {
         BeforePrint bp = new BeforePrint(_data, new int[] { 0 });
         bp.ShowDialog();
     }
 }