本文整理汇总了C#中Fields.AddData方法的典型用法代码示例。如果您正苦于以下问题:C# Fields.AddData方法的具体用法?C# Fields.AddData怎么用?C# Fields.AddData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fields
的用法示例。
在下文中一共展示了Fields.AddData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addReportButton_Click
private void addReportButton_Click(Object sender, EventArgs e)
{
var report = new Report(addTitleTextBox.Text);
var dataSet = new DataSet();
var fields = new Fields();
fields.AddData(new Field(nameTextBox.Text));
fields.AddData(new Field(typeTextBox.Text));
dataSet.Fieldss.AddData(fields);
report.DataSets.AddData(dataSet);
Reports.AddData(report);
RefreshReportForm();
}
示例2: Convert
public static Report Convert(List<List<Object>> objectsList, Report report)
{
if (report == null) return null;
var dataSet = new DataSet();
foreach (var objectList in objectsList)
{
var fields = new Fields();
foreach (object o in objectList)
fields.AddData(!o.Equals(DBNull.Value) ? new Field(o) : new Field("No Value :/"));
dataSet.Fieldss.AddData(fields);
}
report.DataSets.AddData(dataSet);
return report;
}
示例3: modifyButton_Click
private void modifyButton_Click(Object sender, EventArgs e)
{
var report = new Report(modifyTitleTextBox.Text);
var dataSet = new DataSet();
var fields = new Fields();
fields.AddData(new Field(newNameTextBox.Text));
fields.AddData(new Field(newTypeTextBox.Text));
dataSet.Fieldss.AddData(fields);
report.DataSets.AddData(dataSet);
Reports.ModifyData(oldNameTextBox.Text, report);
RefreshReportForm();
}
示例4: Convert
public static Report Convert(DataRowCollection dataRowCollection, Report report)
{
if (dataRowCollection == null || report == null) return null;
var dataSet = new Data.DataSet();
foreach (DataRow dataRow in dataRowCollection)
{
var fields = new Fields();
foreach (object o in dataRow.ItemArray)
fields.AddData(!o.Equals(DBNull.Value) ? new Field(o) : new Field("N/A"));
dataSet.Fieldss.AddData(fields);
}
report.DataSets.AddData(dataSet);
return report;
}
示例5: Parse
public void Parse()
{
int cptReport = -1;
int cptDataSet = -1;
Body body = null;
PageHeader pageHeader = null;
PageFooter pageFooter = null;
Box box = null;
Tablix tablix = null;
TablixBody tablixBody = null;
TablixHeader tablixHeader = null;
TablixFooter tablixFooter = null;
TablixRow tablixRow = null;
TablixCell tablixCell = null;
TablixColumns tablixColumns = null;
TablixColumnsGrouping tablixColumnsGrouping = null;
TablixChart tablixChart = null;
TablixColumnHierarchy tablixColumnHierarchy = null;
Group group = null;
TextBox textBox = null;
Chart chart = null;
bool inBody = false;
bool inPageHeader = false;
bool inPageFooter = false;
bool inBox = false;
bool inTablixBody = false;
bool inTablixHeader = false;
bool inTablixFooter = false;
bool inTablixCell = false;
bool inTablixColumnHierarchy = false;
while (XmlReader.Read())
switch (XmlReader.NodeType)
{
case XmlNodeType.Element:
switch (XmlReader.LocalName)
{
case "Report":
cptReport++;
if (XmlReader.HasAttributes)
{
Reports.DataList[cptReport].Name = XmlReader.GetAttribute("Name");
Boolean displayTitle;
Boolean.TryParse(XmlReader.GetAttribute("DisplayTitle"), out displayTitle);
Reports.DataList[cptReport].DisplayTitle = displayTitle;
}
break;
case "DataSets":
cptDataSet = -1;
break;
case "DataSet":
cptDataSet++;
if (XmlReader.HasAttributes)
Reports.DataList[cptReport].DataSets.DataList[cptDataSet].Name =
XmlReader.GetAttribute("Name");
break;
case "Field":
if (XmlReader.HasAttributes)
Reports.DataList[cptReport].DataSets.DataList[cptDataSet].
FieldDescriptors.AddData(new FieldDescriptor(
XmlReader.GetAttribute("Id"),
XmlReader.GetAttribute("Type")));
break;
case "Body":
inBody = true;
inPageHeader = false;
inPageFooter = false;
inBox = false;
body = new Body();
if (XmlReader.HasAttributes)
{
body.Name = XmlReader.GetAttribute("Name");
body.Style = XmlReader.GetAttribute("Style");
body.Tag = XmlReader.GetAttribute("Tag");
}
break;
case "PageHeader":
inBody = false;
inPageHeader = true;
inPageFooter = false;
inBox = false;
pageHeader = new PageHeader();
if (XmlReader.HasAttributes)
{
pageHeader.Name = XmlReader.GetAttribute("Name");
pageHeader.Style = XmlReader.GetAttribute("Style");
pageHeader.Tag = XmlReader.GetAttribute("Tag");
}
break;
case "PageFooter":
inBody = false;
inPageHeader = false;
inPageFooter = true;
inBox = false;
pageFooter = new PageFooter();
if (XmlReader.HasAttributes)
{
pageFooter.Name = XmlReader.GetAttribute("Name");
pageFooter.Style = XmlReader.GetAttribute("Style");
pageFooter.Tag = XmlReader.GetAttribute("Tag");
}
//.........这里部分代码省略.........