示例#1
0
 private void SetReportToCrv(SortChannelReport allTaskReport)
 {
     if (crvChannelReport.InvokeRequired)
     {
         crvChannelReport.Invoke(new PrintHandler(SetReportToCrv), allTaskReport);
     }
     else
     {
         lblInfo.Visible = false;
         crvChannelReport.ReportSource = allTaskReport;
     }
 }
示例#2
0
        private void GetDataSet()
        {
            try
            {
                using (PersistentManager pmServer = new PersistentManager("ServerConnection"))
                {
                    ServerDao serverDao = new ServerDao();
                    serverDao.SetPersistentManager(pmServer);
                    channelReport = new SortChannelReport();

                    DataTable         printBatchTable   = serverDao.FindPrintBatchTable();
                    PrintSelectDialog printSelectDialog = new PrintSelectDialog(printBatchTable);

                    if (printSelectDialog.ShowDialog() == DialogResult.OK)
                    {
                        string orderDate = "";
                        string batchNo   = "";
                        string lineCode  = "";

                        orderDate = printSelectDialog.SelectedPrintBatch.Split("|"[0])[0];
                        batchNo   = printSelectDialog.SelectedPrintBatch.Split("|"[0])[1];
                        lineCode  = printSelectDialog.SelectedPrintBatch.Split("|"[0])[2];

                        DataTable table = serverDao.FindChannelUSED(orderDate, batchNo, lineCode);

                        if (table.Rows.Count == 0)
                        {
                            throw new Exception("没有数据");
                        }
                        channelReport.SetDataSource(table);
                        SetReportToCrv(channelReport);
                    }
                }
            }
            catch (Exception ex)
            {
                SetLblInfo(ex.Message);
            }
            finally
            {
                //t.Abort();
            }
        }