private void previewInventoryDetail(string pInventoryId) { try { foreach (DataRow _dr in loInventory.getAllData("Stock Receiving", "", pInventoryId, "").Rows) { loStockReceivingDetailRpt.SetDataSource(GlobalVariables.DTCompanyLogo); loStockReceivingDetailRpt.Database.Tables[1].SetDataSource(loInventoryDetail.getInventoryDetails("ViewAll", pInventoryId)); loStockReceivingDetailRpt.SetParameterValue("CompanyName", GlobalVariables.CompanyName); loStockReceivingDetailRpt.SetParameterValue("CompanyAddress", GlobalVariables.CompanyAddress); loStockReceivingDetailRpt.SetParameterValue("CompanyContactNumber", GlobalVariables.ContactNumber); loStockReceivingDetailRpt.SetParameterValue("Username", GlobalVariables.Userfullname); loStockReceivingDetailRpt.SetParameterValue("Title", "Stock Receiving"); loStockReceivingDetailRpt.SetParameterValue("SubTitle", "Stock Receiving"); loStockReceivingDetailRpt.SetParameterValue("SRId", _dr["Id"].ToString()); loStockReceivingDetailRpt.SetParameterValue("Date", _dr["Date"].ToString()); loStockReceivingDetailRpt.SetParameterValue("PreparedBy", _dr["Prepared By"].ToString()); loStockReceivingDetailRpt.SetParameterValue("Reference", _dr["Reference"].ToString()); loStockReceivingDetailRpt.SetParameterValue("POId", _dr["P.O. Id"].ToString()); loStockReceivingDetailRpt.SetParameterValue("Supplier", _dr["Supplier"].ToString()); loStockReceivingDetailRpt.SetParameterValue("FinalizedBy", _dr["Finalized By"].ToString()); loReportViewer.crystalReportViewer.ReportSource = loStockReceivingDetailRpt; loReportViewer.ShowDialog(); } } catch (Exception ex) { throw ex; } }
private void previewDetail(string pId) { try { foreach (DataRow _dr in loInventoryHeader.getAllData("ViewAll", pId, "", "Stock Receiving").Rows) { loStockReceivingDetailRpt.SetDataSource(GlobalVariables.DTCompanyLogo); loStockReceivingDetailRpt.Database.Tables[1].SetDataSource(loInventoryDetail.getAllData(_dr[0].ToString())); loStockReceivingDetailRpt.SetParameterValue("CompanyName", GlobalVariables.CompanyName); loStockReceivingDetailRpt.SetParameterValue("CompanyAddress", GlobalVariables.CompanyAddress); loStockReceivingDetailRpt.SetParameterValue("CompanyContactNumber", GlobalVariables.ContactNumber); loStockReceivingDetailRpt.SetParameterValue("Username", GlobalVariables.Userfullname); loStockReceivingDetailRpt.SetParameterValue("Title", "Stock Receiving Details"); loStockReceivingDetailRpt.SetParameterValue("SubTitle", "Stock Receiving Details"); loStockReceivingDetailRpt.SetParameterValue("Id", _dr["Id"].ToString()); loStockReceivingDetailRpt.SetParameterValue("Date", _dr["Date"].ToString()); loStockReceivingDetailRpt.SetParameterValue("Explanation", _dr["Explanation"].ToString()); loStockReceivingDetailRpt.SetParameterValue("ReceivedBy", _dr["Received By"].ToString()); loStockReceivingDetailRpt.SetParameterValue("Remarks", _dr["Remarks"].ToString()); loReportViewer.crystalReportViewer.ReportSource = loStockReceivingDetailRpt; loReportViewer.ShowDialog(); } } catch { } }
private void previewDetails(string pSRId) { try { foreach (DataRow _dr in loInventoryHeader.getAllData("", pSRId, "", "Stock Receiving").Rows) { DataTable _dt = loInventoryDetail.getAllData(_dr[0].ToString()); loStockReceivingDetailRpt.SetDataSource(GlobalVariables.DTCompanyLogo); loStockReceivingDetailRpt.Database.Tables[1].SetDataSource(_dt); loStockReceivingDetailRpt.SetParameterValue("CompanyName", GlobalVariables.CompanyName); loStockReceivingDetailRpt.SetParameterValue("CompanyAddress", GlobalVariables.CompanyAddress); loStockReceivingDetailRpt.SetParameterValue("CompanyContactNumber", GlobalVariables.ContactNumber); loStockReceivingDetailRpt.SetParameterValue("Username", GlobalVariables.Userfullname); loStockReceivingDetailRpt.SetParameterValue("Title", "Stock Receiving Slip"); loStockReceivingDetailRpt.SetParameterValue("SubTitle", "Stock Receiving Slip"); loStockReceivingDetailRpt.SetParameterValue("Id", _dr["Id"].ToString()); loStockReceivingDetailRpt.SetParameterValue("Date", string.Format("{0:MM-dd-yyyy}", DateTime.Parse(_dr["Date"].ToString()))); foreach (DataRow _dr1 in _dt.Rows) { loStockReceivingDetailRpt.SetParameterValue("Location", _dr1["Location"].ToString()); } loStockReceivingDetailRpt.SetParameterValue("Supplier", _dr["Supplier"].ToString()); loStockReceivingDetailRpt.SetParameterValue("Reference", _dr["Reference"].ToString()); //loStockReceivingDetailRpt.SetParameterValue("TotalAmount", string.Format("{0:n}", decimal.Parse(_dr["Total Amount"].ToString()))); loStockReceivingDetailRpt.SetParameterValue("ReceivedBy", _dr["Username"].ToString()); loStockReceivingDetailRpt.SetParameterValue("Remarks", _dr["Remarks"].ToString()); loReportViewer.crystalReportViewer.ReportSource = loStockReceivingDetailRpt; loReportViewer.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }