private void PrintDoc(int headeroption, int middleoption, int bottomoption) { string reporttitle = formHeadertext.ToUpper(); frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt.FormHeadertext = reporttitle; ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue(); paramFields = commonFunctions.AddCrystalParamsWithLoca(reporttitle, commonFunctions.Loginuser.ToUpper(), commonFunctions.GlobalLocation, findExisting.FindExisitingLoca(commonFunctions.GlobalLocation)); paramField.Name = "status"; paramDiscreteValue.Value = "Original".ToUpper(); paramField.CurrentValues.Add(paramDiscreteValue); paramFields.Add(paramField); rpt_StockCard rptBank = new rpt_StockCard(); if (rdo_productwise.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockBalance("", "", "", headeroption, middleoption, bottomoption))); } else if (rdo_lotwise.Checked) { } rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); }
private void PrintDoc(int typex) { string reporttitle = formHeadertext.ToUpper(); frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt.FormHeadertext = reporttitle; ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue(); paramFields = commonFunctions.AddCrystalParamsWithLoca(reporttitle, commonFunctions.Loginuser.ToUpper(), commonFunctions.GlobalLocation, findExisting.FindExisitingLoca(commonFunctions.GlobalLocation)); paramField.Name = "status"; paramDiscreteValue.Value = "Original".ToUpper(); paramField.CurrentValues.Add(paramDiscreteValue); paramFields.Add(paramField); rpt_StockCard rptBank = new rpt_StockCard(); if (typex == 0) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockCard(commonFunctions.GlobalLocation, typex, txt_itemcode1.Text.Trim(), txt_loca.Text.Trim()))); } else if (typex == 1) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockCard(commonFunctions.GlobalLocation, typex, txt_itemcode1.Text.Trim(), ""))); } rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); }