XtraReports有没有使用说明呢?
XtraReports有没有使用说明呢?
第一次用它,不知道怎么用,极度郁闷!
望师兄师姐赐教!
谢谢!
------解决方案--------------------Reports.AlarmRecordReport report = new Reports.AlarmRecordReport();
report.companyName.Text = Program.CompanyName;
report.fromToDate.Text = fromDateEdit.DateTime.ToString( "yyyy年MM月dd日 ") + "至 " + toDateEdit.DateTime.ToString( "yyyy年MM月dd日 ");
report.DataAdapter = null;
report.DataMember = null;
report.DataSource = report.reportDataSet1.alarm_record;
if ((fromDateEdit.EditValue == null ) || (toDateEdit.EditValue == null )) {
MessageBox.Show( "时间不能为空 ", "警告 ", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if ((DateTime)fromDateEdit.EditValue > (DateTime)toDateEdit.EditValue) {
MessageBox.Show( "开始时间不能大于结束时间 ", "警告 ", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
int siteIndex = this.siteCombox.SelectedIndex - 1;
int cIndex = contaminatorCombox.SelectedIndex - 1;
if (siteCombox.SelectedIndex != 0)
{
siteId = (int)this.eDPDataSet.site.Rows[siteIndex][ "id "];
if (contaminatorCombox.SelectedIndex != 0)
{//选择了所有条件
report.reportDataSet1.alarm_record.Rows.Clear();
contaminatorId = (int)this.eDPDataSet.contaminator.Rows[cIndex][ "id "];
dao.getAlarmRecordByAll(report.reportDataSet1.alarm_record, siteId, (DateTime)fromDateEdit.EditValue, (DateTime)toDateEdit.EditValue, contaminatorId);
printControl1.PrintingSystem = report.PrintingSystem;
report.CreateDocument();
}
else
{//选择了siteId,time
report.reportDataSet1.alarm_record.Rows.Clear();
dao.getAlarmRecordBySiteIdandTime(report.reportDataSet1.alarm_record, siteId, (DateTime)fromDateEdit.EditValue, (DateTime)toDateEdit.EditValue);
printControl1.PrintingSystem = report.PrintingSystem;
report.CreateDocument();
}
}