本文整理汇总了C#中ParameterDiscreteValue类的典型用法代码示例。如果您正苦于以下问题:C# ParameterDiscreteValue类的具体用法?C# ParameterDiscreteValue怎么用?C# ParameterDiscreteValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParameterDiscreteValue类属于命名空间,在下文中一共展示了ParameterDiscreteValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSearch_Click
private void btnSearch_Click(object sender, EventArgs e)
{
string BcDate;
string DueDate;
BcDate = Convert.ToString(dtpfromdate.Text);
DueDate = Convert.ToString(dtpTodate.Text);
ReportDocument reportDocument = new ReportDocument();
ParameterField paramField = new ParameterField();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
string ReportPath = ConfigurationManager.AppSettings["ReportPath"];
paramField.Name = "@BcDate";
paramField.Name = "@DueDate";
paramDiscreteValue.Value = 1;
reportDocument.Load(ReportPath + "Reports\\DateWiseTransactionReport.rpt");
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "DB_LoanApplication";
//connectionInfo.UserID = "wms";
//connectionInfo.Password = "wms";
connectionInfo.IntegratedSecurity = true;
SetDBLogonForReport(connectionInfo, reportDocument);
reportDocument.SetParameterValue("@BcDate", BcDate);
reportDocument.SetParameterValue("@DueDate", DueDate);
DatewisecrystalReport.ReportSource = reportDocument;
DatewisecrystalReport.ToolPanelView = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
}
示例2: FormSupplierPayment_Print_Load
private void FormSupplierPayment_Print_Load(object sender, EventArgs e)
{
try
{
// int TransactionID;
//SaleTransactionID = Convert.ToInt32(cbSupplier.SelectedValue.ToString());
ReportDocument reportDocument = new ReportDocument();
ParameterField paramField = new ParameterField();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
string ReportPath = ConfigurationManager.AppSettings["ReportPath"];
paramField.Name = "@SupplierPaymentID";
paramDiscreteValue.Value = @SupplierPaymentID;
reportDocument.Load(ReportPath+"SupplierPay_Print_CrystalReport.rpt");
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "DB_MedicalShop_02Sept20159PM";
//connectionInfo.UserID = "wms";
//connectionInfo.Password = "wms";
connectionInfo.IntegratedSecurity = true;
SetDBLogonForReport(connectionInfo, reportDocument);
reportDocument.SetParameterValue("@SupplierPaymentID", SupplierPaymentID);
SupplierPyCrystalPrint.ReportSource = reportDocument;
SupplierPyCrystalPrint.ToolPanelView = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
示例3: crystalReportViewer1_Load
private void crystalReportViewer1_Load(object sender, EventArgs e)
{
reportDataBind();
ParameterFields paramFields = new ParameterFields();
ParameterField paramField1 = new ParameterField();
ParameterDiscreteValue discreteVal1 = new ParameterDiscreteValue();
paramField1.ParameterFieldName = "drawingno";
discreteVal1.Value = drawingno;
paramField1.CurrentValues.Add(discreteVal1);
paramFields.Add(paramField1);
ParameterField paramField2 = new ParameterField();
ParameterDiscreteValue discreteVal2 = new ParameterDiscreteValue();
paramField2.ParameterFieldName = "blockno";
discreteVal2.Value = blockno;
paramField2.CurrentValues.Add(discreteVal2);
paramFields.Add(paramField2);
ParameterField paramField3 = new ParameterField();
ParameterDiscreteValue discreteVal3 = new ParameterDiscreteValue();
paramField3.ParameterFieldName = "project";
discreteVal3.Value = project;
paramField3.CurrentValues.Add(discreteVal3);
paramFields.Add(paramField3);
crystalReportViewer1.ParameterFieldInfo = paramFields;
}
示例4: RptCetakKwitansi_Load
private void RptCetakKwitansi_Load(object sender, EventArgs e)
{
string strPath = Application.StartupPath + @"\Form\Report\Kwitansi\RptKwitansi.rpt";
// Object for load report.
ReportDocument rpt = new ReportDocument();
rpt.Load(strPath);
//Set Parameter
ParameterFields pfields = new ParameterFields();
ParameterField pfield = new ParameterField();
ParameterDiscreteValue disValue = new ParameterDiscreteValue();
pfield.Name = "spell";
disValue.Value = spell;
pfield.CurrentValues.Add(disValue);
pfields.Add(pfield);
pfield = new ParameterField();
pfield.Name = "price";
disValue = new ParameterDiscreteValue();
disValue.Value = harga;
pfield.CurrentValues.Add(disValue);
pfields.Add(pfield);
pfield = new ParameterField();
pfield.Name = "keterangan";
disValue = new ParameterDiscreteValue();
disValue.Value = ket;
pfield.CurrentValues.Add(disValue);
pfields.Add(pfield);
crystalReportViewer1.ParameterFieldInfo = pfields;
crystalReportViewer1.ReportSource = rpt;
crystalReportViewer1.Refresh();
}
示例5: button1_Click
private void button1_Click(object sender, EventArgs e)
{
try
{
ReportDocument crystalrpt = new ReportDocument();
crystalrpt.Load(@"C:\Users\Lahkrome\Desktop\Beta Sinergia\alfa2_Sinergia\CrystalReport.rpt");
//crystalReportViewer1.ReportSource = crystalrpt;
//crystalReportViewer1.Refresh();
ParameterFieldDefinitions crParameterFieldDefinitions;
ParameterFieldDefinition crParameterFieldDefinition;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
crParameterDiscreteValue.Value = textBox1.Text;
crParameterFieldDefinitions = crystalrpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["ProductName"];
crParameterValues = crParameterFieldDefinition.CurrentValues;
crParameterValues.Clear();
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
crystalReportViewer1.ReportSource = crystalrpt;
crystalReportViewer1.Refresh();
}
catch (Exception ex)
{
MessageBox.Show("Error"+ex);
}
}
示例6: setParameters
public void setParameters(ReportDocument Rpt)
{
ParameterFields paramFields = new ParameterFields();
if (HttpContext.Current.Request.QueryString["MailingId"] != null && HttpContext.Current.Request.QueryString["MailingId"] != string.Empty)
{
ParameterField MailingId = new ParameterField();
MailingId.ParameterFieldName = "@CampaignId";
ParameterDiscreteValue dcMailingId = new ParameterDiscreteValue();
dcMailingId.Value = Convert.ToInt32(Request.QueryString["MailingId"].ToString());
MailingId.CurrentValues.Add(dcMailingId);
paramFields.Add(MailingId);
}
else
{
ParameterField CampId = new ParameterField();
CampId.ParameterFieldName = "@AssignedCampaignID";
ParameterDiscreteValue dcCampId = new ParameterDiscreteValue();
dcCampId.Value = Convert.ToInt32(Request.QueryString["CampId"].ToString());
CampId.CurrentValues.Add(dcCampId);
paramFields.Add(CampId);
}
CrystalReportViewer1.ParameterFieldInfo = paramFields;
CrystalReportViewer1.ReportSource = Rpt;
CrystalReportViewer1.DataBind();
}
示例7: SetBuildProjectParameter
private void SetBuildProjectParameter()
{
foreach (ParameterField p in _reportDoc.ParameterFields)
{
if (p.Name.ToLower().Trim().Replace(" ", "") == "buildproject"
&& p.ParameterValueType == ParameterValueKind.NumberParameter)
{
p.DefaultValues.Clear();
DataSet ds = VmData.GetBuildProjectParameterDefaults();
foreach (DataRow dr in ds.Tables[0].Rows)
{
ParameterDiscreteValue pv = new ParameterDiscreteValue();
//ParameterDiscreteValue val = new ParameterDiscreteValue();
pv.Value = (int)dr["pkBuildProject"];
pv.Description = (string)dr["Description"];
p.DefaultValues.Add(pv);
p.DefaultValues[p.DefaultValues.Count - 1].Description = (string)dr["Description"];
}
p.DefaultValueDisplayType = DefaultValueDisplayType.Description;
break;
}
}
}
示例8: GroupReport_Load
private void GroupReport_Load(object sender, EventArgs e)
{
repDoc = new ReportDocument();
ParameterFields rptParams;
ParameterValues paramValues;
ParameterDiscreteValue paramDiscreteValue;
ParameterField paramField;
try
{
repDoc.Load("../../Reports/Group.rpt");
//repDoc.Load("C:\\Users\\keith.sullivan\\Documents\\CIS\\CISApp\\CISApp\\Reports\\Group.rpt");
rptParams = repDoc.ParameterFields;
paramValues = new ParameterValues();
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = groupId;
paramValues.Add(paramDiscreteValue);
paramField = rptParams["studentgroup"];
paramField.CurrentValues = paramValues;
crystalReportViewer1.ReportSource = repDoc;
crystalReportViewer1.Refresh();
}
catch (Exception ex)
{
Console.WriteLine(ex);
Console.WriteLine("Could not connect to report");
}
}
示例9: setParameters
public void setParameters(ReportDocument Rpt)
{
if (HttpContext.Current.Request.QueryString["StartDate"] != null && HttpContext.Current.Request.QueryString["EndDate"] != null)
{
ParameterFields paramFields = new ParameterFields();
ParameterField StartDay, EndDay;
ParameterDiscreteValue dcStartDay, dcEndDay;
StartDay = new ParameterField();
StartDay.ParameterFieldName = "@FromDate";
dcStartDay = new ParameterDiscreteValue();
dcStartDay.Value = Request.QueryString["StartDate"].ToString();
EndDay = new ParameterField();
EndDay.ParameterFieldName = "@ToDate";
dcEndDay = new ParameterDiscreteValue();
dcEndDay.Value = Request.QueryString["EndDate"].ToString();
StartDay.CurrentValues.Add(dcStartDay);
EndDay.CurrentValues.Add(dcEndDay);
paramFields.Add(StartDay);
paramFields.Add(EndDay);
AdminActivityCRViewer.ParameterFieldInfo = paramFields;
AdminActivityCRViewer.ReportSource = Rpt;
AdminActivityCRViewer.DataBind();
}
}
示例10: button1_Click
private void button1_Click(object sender, EventArgs e)
{
var report = new rptTestimonial();
ParameterValues pvValues = new ParameterValues();
ParameterDiscreteValue pdvDiscreteValue = new ParameterDiscreteValue();
pdvDiscreteValue.Value = textBox1.Text;
pvValues.Add(pdvDiscreteValue);
ParameterFieldDefinitions pfdDefinitions = report.DataDefinition.ParameterFields;
ParameterFieldDefinition prdDefinition = pfdDefinitions["textThing"];
prdDefinition.ApplyCurrentValues(pvValues);
/*var data =
Database.Row("learner_details a, enrollments b, enrollmentscourses c, courses d",
"a.Division = '" + clsGlobal.loggedOnUserDivison + "' AND a.LearnerNumber = '" +
number.Selection +
"' AND b.LearnerKey = a.LearnerKey AND c.idEnrollments = b.idEnrollments AND" +
" d.idCourses = c.idCourses");*/
report.DataDefinition.FormulaFields["mainText"].Text = "\"" + textBox1.Text + "\"";
report.DataDefinition.FormulaFields["principle"].Text = "\"" + GlobalProperties.DivisionPrinciple + "\"";
report.DataDefinition.FormulaFields["name"].Text = "\"" + learner["Surname"] + ", " + learner["name"]+ "\"";
report.DataDefinition.FormulaFields["learnerNumber"].Text = "\"" + number + "\"";
//report.DataDefinition.FormulaFields["respParty"].Text = "\"" + clsGlobal.loggedOnUser + "\"";
//report.DataDefinition.FormulaFields["course"].Text = "\"" + Convert.ToString(data["Name1"]) + "\"";
//logs.WriteXml(@"C:\tmpXml.xml");
var frmReport = new frmReport(report) { Text = "Testimonial" };
frmReport.ShowDialog();
}
示例11: LoadReportFile
private void LoadReportFile(string rptName, string procName, string rptTitle, Dictionary<string, string> paraValues, Dictionary<string, string> procValues)
{
try
{
string rptPath = Server.MapPath("/ReportPages/" + rptName);
_rptDoc = new ReportDocument();
_rptDoc.Load(rptPath);
_rptDoc.SummaryInfo.ReportTitle = rptTitle;
_rptDoc.SetDataSource(ExcuteQuery(procName, procValues));
if (paraValues.Count > 0)
foreach (KeyValuePair<string, string> par in paraValues)
{
ParameterDiscreteValue pValue = new ParameterDiscreteValue();
pValue.Value = par.Value;
ParameterFieldDefinition pDef = _rptDoc.DataDefinition.ParameterFields[par.Key];
pDef.CurrentValues.Clear();
pDef.CurrentValues.Add(pValue);
pDef.ApplyCurrentValues(pDef.CurrentValues);
}
crystalReportViewer.ReportSource = _rptDoc;
}
catch (Exception e)
{
label.Text = "Report Error: " + e.Message;
}
finally
{
GC.Collect();
}
}
示例12: ReportDocument
private void Reporte_de_Gastos_de_Inversión_Load(object sender, EventArgs e)
{
//Diseño de la ventana
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(228)))), ((int)(((byte)(196)))));
this.Icon = global::Sistema_Shajobe.Properties.Resources.Caja_ICO;
//REPORTE CRISTAL REPORT
//PRIMER PARAMETRO
ReportDocument reporte = new ReportDocument();
ParameterField parametro = new ParameterField();
ParameterFields parametros = new ParameterFields();
ParameterDiscreteValue discretos = new ParameterDiscreteValue();
parametro.Name = "@Apartir";
discretos.Value = Convert.ToDateTime(_Apartir);
parametro.CurrentValues.Add(discretos);
parametros.Add(parametro);
//SEGUNDO PARAMETRO
ParameterField parametro1 = new ParameterField();
ParameterDiscreteValue discretos1 = new ParameterDiscreteValue();
parametro1.Name = "@Hasta";
discretos1.Value = Convert.ToDateTime(_Hasta);
parametro1.CurrentValues.Add(discretos1);
parametros.Add(parametro1);
crystalReportViewer1.ParameterFieldInfo = parametros;
crystalReportViewer1.ReportSource = RGastosInventario1;
}
示例13: loadAdjustmentVoucherReport
private void loadAdjustmentVoucherReport()
{
PrintReportViewer.ParameterFieldInfo["VoucherNo"].CurrentValues.Clear();
PrintReportViewer.ParameterFieldInfo["Supervisor"].CurrentValues.Clear();
PrintReportViewer.ParameterFieldInfo["date"].CurrentValues.Clear();
PrintReportViewer.ParameterFieldInfo["authorizedBy"].CurrentValues.Clear();
ParameterField f1 = PrintReportViewer.ParameterFieldInfo["VoucherNo"];
ParameterDiscreteValue v1 = new ParameterDiscreteValue();
v1.Value = Util.GetSession("VoucherNo");
f1.CurrentValues.Add(v1);
ParameterField f2 = PrintReportViewer.ParameterFieldInfo["Supervisor"];
ParameterDiscreteValue v2 = new ParameterDiscreteValue();
v2.Value = Util.GetSession("Supervisor");
f2.CurrentValues.Add(v2);
ParameterField f3 = PrintReportViewer.ParameterFieldInfo["date"];
ParameterDiscreteValue v3 = new ParameterDiscreteValue();
v3.Value = Util.GetSession("date");
f3.CurrentValues.Add(v3);
ParameterField f4 = PrintReportViewer.ParameterFieldInfo["authorizedBy"];
ParameterDiscreteValue v4 = new ParameterDiscreteValue();
v4.Value = Util.GetSession("authorizedBy");
f4.CurrentValues.Add(v4);
PrintReportViewer.DataBind();
Util.RemoveSession("VoucherNo");
Util.RemoveSession("Supervisor");
Util.RemoveSession("date");
Util.RemoveSession("authorizedBy");
}
示例14: InitializeReport
private void InitializeReport()
{
ReportDocument REPORT_DOC = new ReportDocument();
REPORT_DOC = new RptSummaryMonthlyPilferageDeptStores();
DataBaseLogIn(REPORT_DOC);
ParameterField prmBrand = new ParameterField();
ParameterField prmDateFrom = new ParameterField();
ParameterField prmDateTo = new ParameterField();
ParameterFields prmList = new ParameterFields();
prmBrand.ParameterFieldName = "@BRAND_NAME";
prmDateFrom.ParameterFieldName = "@DATE_FROM";
prmDateTo.ParameterFieldName = "@DATE_TO";
ParameterDiscreteValue prmBrandValue = new ParameterDiscreteValue();
ParameterDiscreteValue prmDateFromValue = new ParameterDiscreteValue();
ParameterDiscreteValue prmDateToValue = new ParameterDiscreteValue();
prmBrandValue.Value = Request.QueryString["Brand"];
prmDateFromValue.Value = Request.QueryString["DateFrom"];
prmDateToValue.Value = Request.QueryString["DateTo"];
prmBrand.CurrentValues.Add(prmBrandValue);
prmDateFrom.CurrentValues.Add(prmDateFromValue);
prmDateTo.CurrentValues.Add(prmDateToValue);
prmList.Add(prmBrand);
prmList.Add(prmDateFrom);
prmList.Add(prmDateTo);
this.SummaryOfMonthlyPilferagePerDepartmentStores.ParameterFieldInfo = prmList;
SummaryOfMonthlyPilferagePerDepartmentStores.ReportSource = REPORT_DOC;
}
开发者ID:DennisPitallano,项目名称:IRMS-ACCOUNTING,代码行数:33,代码来源:MonthlySummaryPilferageReportDepartmentStore.aspx.cs
示例15: btnSearch_Click
private void btnSearch_Click(object sender, EventArgs e)
{
int DoctorID;
DoctorID = Convert.ToInt32(cbDoctor.SelectedValue.ToString());
ReportDocument reportDocument = new ReportDocument();
ParameterField paramField = new ParameterField();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
string ReportPath = ConfigurationManager.AppSettings["ReportPath"];
paramField.Name = "@DoctorID";
paramDiscreteValue.Value = DoctorID;
reportDocument.Load(ReportPath + "Report\\DoctorCrystalReport.rpt");
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "DB_MedicalShop_02Sept20159PM";
//connectionInfo.UserID = "wms";
//connectionInfo.Password = "wms";
connectionInfo.IntegratedSecurity = true;
SetDBLogonForReport(connectionInfo, reportDocument);
reportDocument.SetParameterValue("@DoctorID", DoctorID);
DoctorCrystalRpt.ReportSource = reportDocument;
DoctorCrystalRpt.ToolPanelView = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
}