protected void Print_btn_Click(object sender, EventArgs e) { System.Windows.Forms.Cursor.Current = Cursors.WaitCursor; var dInitDate = Convert.ToDateTime(string.Format("{0:d}", ShopDateTime.Instance.ShopDate)); var stoNum = GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber; string fileName = @"loan_listing_report_" + dInitDate.Ticks + ".pdf"; string rptDir = SecurityAccessor.Instance.EncryptConfig.ClientConfig.GlobalConfiguration. BaseLogPath; LoanListingReport rpt = new LoanListingReport( rptDir + "\\" + fileName, stoNum, GlobalDataAccessor.Instance.CurrentSiteId.StoreName, dInitDate, "Loan Listing \n\n" + criteriaSummary_txt.Text, _theCriteria.sortByField() ); rpt.CreateReport(_theData); this.TopMost = false; System.Windows.Forms.Cursor.Current = Cursors.Default; DesktopSession.ShowPDFFile(rptDir + "\\" + fileName, false); }
private void Print_btn_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; var dInitDate = Convert.ToDateTime(string.Format("{0:d}", ShopDateTime.Instance.ShopDate)); var stoNum = GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber; string fileName = @"partial_payment_detail_report_" + dInitDate.Ticks + ".pdf"; string rptDir = SecurityAccessor.Instance.EncryptConfig.ClientConfig.GlobalConfiguration.BaseLogPath; var rpt = new PartialPaymentDetailReport( rptDir + "\\" + fileName, stoNum, GlobalDataAccessor.Instance.CurrentSiteId.StoreName, dInitDate); var key = _selectedData[_rowNum].Row.Field <Int64>("RECEIPTDETAIL_NUMBER"); DataView reportView = _selectedData.DataViewManager.CreateDataView(_selectedData.Table); reportView.RowFilter = "RECEIPTDETAIL_NUMBER='" + key + "'"; rpt.CreateReport(reportView); this.TopMost = false; this.BringToFront(); Cursor.Current = Cursors.Default; DesktopSession.ShowPDFFile(rptDir + "\\" + fileName, false); }
private void PrintPDFReport(CustomerVO currentCustomer, List <HoldData> policeHolds) { // 03082012 TG - Add printing using iText# //var rtcReport = new Reports.ReleaseToClaimantReport(); var phReport = new Reports.PoliceHoldReport(); var reportObject = new ReportObject(); reportObject.ReportTempFile = SecurityAccessor.Instance.EncryptConfig.ClientConfig.GlobalConfiguration.BaseLogPath; reportObject.CreateTemporaryFullName(); phReport.reportObject = reportObject; phReport.ReportTempFileFullName = reportObject.ReportTempFileFullName; // set store information phReport.STORE_NAME = ProcessTenderController.STORE_NAME; phReport.STORE_ADDRESS = ProcessTenderController.STORE_ADDRESS; phReport.STORE_CITY = ProcessTenderController.STORE_CITY; phReport.STORE_STATE = ProcessTenderController.STORE_STATE; phReport.STORE_ZIP = ProcessTenderController.STORE_ZIP; phReport.CurrentCust = currentCustomer; // Pass hold data phReport.HoldData = policeHolds[0]; if (phReport.CreateReport()) { DesktopSession.ShowPDFFile(phReport.reportObject.ReportTempFileFullName, false); this.TopMost = false; } }
protected void Print_btn_Click(object sender, EventArgs e) { System.Windows.Forms.Cursor.Current = Cursors.WaitCursor; var dInitDate = Convert.ToDateTime(string.Format("{0:d}", ShopDateTime.Instance.ShopDate)); var stoNum = GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber; //string fileName = @"mdse_listing_report_" + dInitDate.Ticks + ".pdf"; string rptDir = SecurityAccessor.Instance.EncryptConfig.ClientConfig.GlobalConfiguration. BaseLogPath; var reportFilterSelect = new ReportType(); this.TopMost = false; reportFilterSelect.ShowDialog(); if (reportFilterSelect.DialogResult == DialogResult.OK) { string[] filters = reportFilterSelect.getFilters(); string[] filterNames = reportFilterSelect.getFilterNames(); if (filters.GetLength(0) > 0) { for (int i = 0; i < filters.GetLength(0); i++) { string fileName = @"mdse_listing_report_" + i + "_" + dInitDate.Ticks + ".pdf"; string filter = filters[i]; _theData.Tables["MDSE"].DefaultView.RowFilter = filter; MdseListingReport rpt = new MdseListingReport( rptDir + "\\" + fileName, stoNum, GlobalDataAccessor.Instance.CurrentSiteId.StoreName, dInitDate, "Inventory Listing: " + filterNames[i] + "\n\n" + ((InventoryInquiries)_theCriteria).ToString(80), _theCriteria.sortByField(), _theCriteria.sortByName() ); rpt.CreateReport(_theData.Tables["MDSE"].DefaultView); System.Windows.Forms.Cursor.Current = Cursors.Default; DesktopSession.ShowPDFFile(rptDir + "\\" + fileName, false); _theData.Tables["MDSE"].DefaultView.RowFilter = ""; } } else { MessageBox.Show("No Report Type Selected"); } } else { MessageBox.Show("No Report Type Selected"); } }
protected void Print_btn_Click(object sender, EventArgs e) { string rptDir = SecurityAccessor.Instance.EncryptConfig.ClientConfig.GlobalConfiguration.BaseLogPath; var ro = new ReportObject(); //var report = new Reports.Inquiry.PartialPaymentListingReport(ro.ReportTitle, ro.ReportStore, ro.ReportStoreDesc, ro.ReportTitle, string.Empty, string.Empty); var report = new Reports.Inquiry.PartialPaymentListingReport(PdfLauncher.Instance); ro.CreateTemporaryFullName(); ro.ReportTempFileFullName = rptDir + ro.ReportTempFileFullName; ro.ReportTitle = "Partial Payment Listing"; ro.ReportStore = GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber; ro.ReportStoreDesc = GlobalDataAccessor.Instance.CurrentSiteId.StoreName; ro.ReportSort = "USERID"; report.reportObject = ro; var dv = _theData.DefaultViewManager.CreateDataView(_theData.Tables[0]); var isSuccessful = report.CreateReport(_theData.Tables[0]); DesktopSession.ShowPDFFile(report.reportObject.ReportTempFileFullName, false); this.TopMost = false; }
private void Print_btn_Click(object sender, EventArgs e) { System.Windows.Forms.Cursor.Current = Cursors.WaitCursor; var dInitDate = Convert.ToDateTime(string.Format("{0:d}", ShopDateTime.Instance.ShopDate)); var stoNum = GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber; string fileName = @"extension_detail_report_" + dInitDate.Ticks + ".pdf"; string rptDir = SecurityAccessor.Instance.EncryptConfig.ClientConfig.GlobalConfiguration. BaseLogPath; var rpt = new ExtensionReport( rptDir + "\\" + fileName, stoNum, GlobalDataAccessor.Instance.CurrentSiteId.StoreName, dInitDate, "Loan Extension\nTicket # " + cur_loan_nr.Text ); rpt.CreateReport(_theData); this.TopMost = false; System.Windows.Forms.Cursor.Current = Cursors.Default; DesktopSession.ShowPDFFile(rptDir + "\\" + fileName, false); }
private void Print_btn_Click(object sender, EventArgs e) { string rptDir = SecurityAccessor.Instance.EncryptConfig.ClientConfig.GlobalConfiguration.BaseLogPath; var ro = new ReportObject(); ro.CreateTemporaryFullName(); ro.ReportTempFileFullName = rptDir + ro.ReportTempFileFullName; ro.ReportStore = GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber; ro.ReportStoreDesc = GlobalDataAccessor.Instance.CurrentSiteId.StoreName; ro.ReportSort = "USERID"; ro.RunDate = DateTime.Now.ToShortDateString(); switch (_transferTypeEnum) { case (TransferTypeEnum.BANK): { var report = new CashTransferBankTransferReport(); report.reportObject = ro; var isSuccessful = report.CreateReport(_theData.Tables[0]); if (isSuccessful) { DesktopSession.ShowPDFFile(report.reportObject.ReportTempFileFullName, false); this.TopMost = false; } } break; case (TransferTypeEnum.INTERNAL): { var report = new CashTransferInternalTransferReport(); report.reportObject = ro; var isSuccessful = report.CreateReport(_theData.Tables[0]); if (isSuccessful) { DesktopSession.ShowPDFFile(report.reportObject.ReportTempFileFullName, false); this.TopMost = false; } } break; case (TransferTypeEnum.SHOP): { var report = new CashTransferShopToShopTransferReport(); report.reportObject = ro; var isSuccessful = report.CreateReport(_theData.Tables[0]); if (isSuccessful) { DesktopSession.ShowPDFFile(report.reportObject.ReportTempFileFullName, false); this.TopMost = false; } } break; default: System.Diagnostics.Debug.Assert(false, "Unhandled Condition. Forget to add handler?"); break; } }
private void viewDocButton_Click(object sender, EventArgs e) { //Ensure that the button is not clicked twice this.viewDocButton.Enabled = false; //Get the accessors var cds = GlobalDataAccessor.Instance.DesktopSession; var cC = GlobalDataAccessor.Instance.CouchDBConnector; //Retrieve the document data var pLoadMesg = new ProcessingMessage("* Loading Document *"); //Connect to couch and retrieve document Document doc; string errText; if (!CouchDbUtils.GetDocument( this.StorageId, cC, out doc, out errText)) { pLoadMesg.Close(); pLoadMesg.Dispose(); this.showErrorMessage("view", errText); this.Close(); } else if (doc != null) { pLoadMesg.Message = "* Document Loaded...Displaying *"; //Fetch data string tmpFileName; byte[] fileData; if (!doc.GetSourceData(out fileData)) { this.showErrorMessage("view", "Cannot retrieve file data to show file"); pLoadMesg.Close(); pLoadMesg.Dispose(); this.Close(); return; } //Create temporary file if (!this.createTempFile(fileData, out tmpFileName)) { this.showErrorMessage("view", "Cannot generate file data to show file"); pLoadMesg.Close(); pLoadMesg.Dispose(); this.Close(); return; } pLoadMesg.Close(); pLoadMesg.Dispose(); switch (this.DocumentType) { case Document.DocTypeNames.PDF: DesktopSession.ShowPDFFile(tmpFileName, true); break; case Document.DocTypeNames.RECEIPT: //GJL - do nothing for now until complete receipt renderer ReceiptRenderer receiptR = new ReceiptRenderer(fileData); //Desktop.PrintQueue.ReceiptRenderer receiptR = new Desktop.PrintQueue.ReceiptRenderer(fileData); //receiptDataRetrieved = receiptR.ExecuteServicePawnLoanForReceiptRenderer(this.DocInfo); //receiptR.RichTextBoxContent = bbyteArrayString; receiptR.ShowDialog(); //MessageBox.Show("Show receipt renderer"); //Invoke View receipt rendering form break; case Document.DocTypeNames.BARCODE: MessageBox.Show("Nothing to show"); //Nothing for now) break; case Document.DocTypeNames.TEXT: MessageBox.Show("Nothing to show"); //Nothing for now) //Notepad?? break; case Document.DocTypeNames.BINARY: MessageBox.Show("Nothing to show"); //Nothing for now) //Nothing for now break; case Document.DocTypeNames.INVALID: MessageBox.Show("Nothing to show"); //Nothing for now) //Nothing for now break; } //Delete temporary file try { File.Delete(tmpFileName); } catch (Exception eX) { if (FileLogger.Instance.IsLogError) { FileLogger.Instance.logMessage(LogLevel.ERROR, this, "Could not delete file: {0} Exception: {1}", tmpFileName, eX); } } } //Re-enable show button this.viewDocButton.Enabled = true; }
public bool View(DesktopSession dSession) { //Get the accessors Document doc; var cds = dSession; var cC = GlobalDataAccessor.Instance.CouchDBConnector; //Retrieve the document data var pLoadMesg = new ProcessingMessage("* Loading Document *"); //Connect to couch and retrieve document string errText; if (!CouchDbUtils.GetDocument( this.StorageId, cC, out doc, out errText)) { pLoadMesg.Close(); pLoadMesg.Dispose(); this.ShowErrorMessage("view", errText); return(true); } else if (doc != null) { pLoadMesg.Message = "* Document Loaded...Displaying *"; //Fetch data string tmpFileName; byte[] fileData; if (!doc.GetSourceData(out fileData)) { this.ShowErrorMessage("view", "Cannot retrieve file data to show file"); pLoadMesg.Close(); pLoadMesg.Dispose(); return(true); } //Create temporary file if (!this.CreateTempFile(fileData, out tmpFileName)) { this.ShowErrorMessage("view", "Cannot generate file data to show file"); pLoadMesg.Close(); pLoadMesg.Dispose(); return(true); } pLoadMesg.Close(); pLoadMesg.Dispose(); string bbyteArrayString = ByteArrayToString(fileData); char[] buf = bbyteArrayString.ToCharArray(); if (this.DocumentType == Document.DocTypeNames.RECEIPT && buf[0] == '%' && buf[1] == 'P' && buf[2] == 'D' && buf[3] == 'F') { this.DocumentType = Document.DocTypeNames.PDF; } switch (this.DocumentType) { case Document.DocTypeNames.PDF: DesktopSession.ShowPDFFile(tmpFileName, true); break; case Document.DocTypeNames.RECEIPT: //GJL - do nothing for now until complete receipt renderer var receiptR = new ReceiptRenderer(fileData); //receiptR.RichTextBoxContent = bbyteArrayString; receiptR.ShowDialog(); //MessageBox.Show("Show receipt renderer"); //Invoke View receipt rendering form break; case Document.DocTypeNames.BARCODE: MessageBox.Show("Nothing to show"); //Nothing for now) break; case Document.DocTypeNames.TEXT: MessageBox.Show("Nothing to show"); //Nothing for now) //Notepad?? break; case Document.DocTypeNames.BINARY: MessageBox.Show("Nothing to show"); //Nothing for now) //Nothing for now break; case Document.DocTypeNames.INVALID: MessageBox.Show("Nothing to show"); //Nothing for now) //Nothing for now break; } //Reset the storage id in case it's called again. //this.StorageId = ""; //Delete temporary file try { File.Delete(tmpFileName); } catch (Exception eX) { if (FileLogger.Instance.IsLogError) { FileLogger.Instance.logMessage(LogLevel.ERROR, this, "Could not delete file: {0} Exception: {1}", tmpFileName, eX); } } } return(false); }