//
        private void Print(IList<UndeclaredCollectionRecord> collectionRecords, string userName)
        {
            int batchNo = 0;
            int nMachineCount = 0;
            string sDropType = string.Empty;
            string sExchangeConnectionString = string.Empty;
            string sTicketConnectionString = string.Empty;
            DataSet DSDeclaration;
            ILiquidationDetails details = LiquidationBusinessObject.CreateInstance();
            try
            {
                batchNo = ((UndeclaredCollection)cboMachineType.SelectedItem).Collection_Batch_No;
                nMachineCount = collectionRecords.Count - 1;
                sDropType = string.Empty;
                foreach (UndeclaredCollectionRecord Collection in collectionRecords)
                {
                    /*if (sDropType == string.Empty)
                    {
                        sDropType = Collection.Type == "Defloat" ? "Final" : "Standard";
                    }
                    else*/
                    {
                        switch (Collection.Type)
                        {
                            case "Defloat":
                                if (!sDropType.Contains("Final"))
                                    sDropType = sDropType + (sDropType.Length >0?", ":"") + "Final";
                                break;
                            case "Total":
                                break;
                            default:
                                if (!sDropType.Contains("Standard"))
                                    sDropType = sDropType + (sDropType.Length > 0 ? ", " : "") + "Standard";
                                break;
                        }
                        
                }
                }
                

                if (collectionRecords.Count >1)
                {
                    if (collectionRecords[1].CollectionBatchNo == 0)
                    {
                        sDropType = "Part";
                    }
                }

                bool bAddShortPay = false;
                try
                {   bAddShortPay = Convert.ToBoolean(details.GetSetting("AddShortpayInVoucherOut"));    }
                catch{}

                DSDeclaration = GetBatchDataset(collectionRecords, bAddShortPay);
                if (DSDeclaration.Tables[0].Rows.Count == 0)
                {
                    MessageBox.ShowBox("MessageID261", BMC_Icon.Information);
                    return;
                }
                if (isCommonCDOforDeclaration)
                {
                    sExchangeConnectionString = (cboSiteCode.SelectedItem as SiteConfig).ExchangeConnectionString;
                    sTicketConnectionString = (cboSiteCode.SelectedItem as SiteConfig).TicketConnectionString;
                }
                using (CReportViewer cReportViewer = new CReportViewer())
                {
                    cReportViewer.ShowDeclarationReport(DSDeclaration, userName, batchNo, nMachineCount, sDropType,
                        sExchangeConnectionString, sTicketConnectionString);
                    cReportViewer.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                MessageBox.ShowBox("MessageID262", BMC_Icon.Error);
            }

        }