本文整理汇总了C#中XtraReport类的典型用法代码示例。如果您正苦于以下问题:C# XtraReport类的具体用法?C# XtraReport怎么用?C# XtraReport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XtraReport类属于命名空间,在下文中一共展示了XtraReport类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PianoRatealeSubreport
public PianoRatealeSubreport(IList<ReportRataSoggettoDTO> dataSource, CondominioDTO condominio, EsercizioDTO esercizio, PianoRatealeReportParameters parameters, ImpostazioneReportDTO impostazioneReportDTO, decimal importoTotale) : base(condominio, esercizio, null ,null, false, true)
{
_impostazioneReportDTO = impostazioneReportDTO;
base.Inizializza(impostazioneReportDTO, parameters.Note);
if (impostazioneReportDTO.MultiPage)
{
var helper = new PianoRatealeHelper(dataSource, impostazioneReportDTO);
var columns = helper.GetColumnList(null, null, null, null);
var pagine = columns.Select(item => item.PrintPage).Distinct().ToList();
_mergeReports = new List<PianoRatealeSinglePage>(pagine.Count);
foreach (var i in pagine)
{
var columnsPage = columns.Where(item => item.PrintPage == i).Select(item => item.Order);
var dataSourcePage = dataSource.Where(item => (item.NumeroRata == 0 && item.NumeroRata == 0) || columnsPage.Contains(item.NumeroRata)).ToList();
var pageReport = new PianoRatealeSinglePage(dataSourcePage, condominio, esercizio, parameters, impostazioneReportDTO, importoTotale, i, true);
_mergeReports.Add(pageReport);
pageReport.CreateDocument(impostazioneReportDTO);
}
_reportMerge = _report;
_reportMerge.BeforePrint += XtraReportMerged_BeforePrint;
}
else
{
var riparto = new PianoRatealeSinglePage(dataSource, condominio, esercizio, parameters, impostazioneReportDTO, importoTotale, null, false);
var report = riparto.GetReport();
_reportMerge = report;
}}
示例2: SaveReport
public void SaveReport(XtraReport report) {
XafReport xafReport = report as XafReport;
if(xafReport == null) {
throw new ArgumentException("XafReport is expected", "report");
}
XafReportSerializationHelper.SaveReport(this, xafReport);
}
示例3: Assign
public void Assign(XtraReport report, XRTable captionTable, XRTable dataTable)
{
DetachEvents();
_report = report;
_captionTable = captionTable;
SetCaptions();
_dataTable = dataTable;
WireUpEvents();
//
if(ManualFill && ! ManualFillOnly)
{
XRTableRow dataRow = _dataTable.Rows.FirstRow;
_dataTable.InsertRowBelow(dataRow);
XRTableRow manualFillRow = _dataTable.Rows[1];
// set tags for cells 1 - 7 (days of week, first cell is name)
for(int idx = 0; idx < manualFillRow.Cells.Count; idx++)
{
if (idx>0 && idx<=7)
{
manualFillRow.Cells[idx].Tag = dataRow.Cells[idx].Tag;
manualFillRow.Cells[idx].BeforePrint += PrintManualFillCell;
}
manualFillRow.Cells[idx].Borders = dataRow.Cells[idx].Borders;
manualFillRow.Cells[idx].Font = dataRow.Cells[idx].Font;
}
if(!HideSums)
{
manualFillRow.Cells[8].BackColor = Color.Black;
}
}
}
示例4: Should_fire_actions_on_table_members
public void Should_fire_actions_on_table_members()
{
var transformColor = Color.Blue;
var action = new ReportControlAction<XRControl>(c => true, c => c.BackColor = transformColor);
var table = new XRTable();
var row = new XRTableRow();
var cell = new XRTableCell();
row.Cells.Add(cell);
table.Rows.Add(row);
var report = new XtraReport();
report.Bands.Add(new DetailBand());
report.Bands[0].Controls.Add(table);
//var subscriber = XRRuntimeSubscriber.SubscribeWithActions(action);
var reportb = new ReportController(new EventAggregator(), report, new ReportControlActionFacade(action)).Print(r => r.ExportToMemory());
var tableB = (XRTable)reportb.Bands[0].Controls[0];
var rowB = tableB.Rows[0];
var cellb = rowB.Cells[0];
Assert.AreEqual(transformColor, cellb.BackColor);
}
示例5: SaveReport
public override void SaveReport(XtraReport report)
{
base.SaveReport(report);
CustomXafReport xafReport = (CustomXafReport)report;
this.ReportId = xafReport.ReportId;
this.ReportName = xafReport.ReportName;
}
示例6: Should_print_multiple_times_with_actions_firing_correct_count
public void Should_print_multiple_times_with_actions_firing_correct_count()
{
var counter = 0;
var report = new XtraReport();
report.Bands.Add(new DetailBand());
report.Bands[0].Controls.Add(new XRLine());
var facade =
new ReportControlActionFacade(ReportControlAction<XRLine>.WithNoPredicate(l =>
{
l.ForeColor =
Color.Blue;
counter++;
}));
var controller = new ReportController(new EventAggregator(), report,facade);
var newReport1 = controller.Print(r => r.ExportToMemory());
var newReport2 = controller.Print(r => r.ExportToMemory());
newReport1.Bands[0].Controls[0].ForeColor.Should().Be(Color.Blue,"Action should have been applied to control");
newReport2.Bands[0].Controls[0].ForeColor.Should().Be(Color.Blue, "Action should have been applied to control");
counter.Should().Be(2,"Action should only have fired once for each time");
}
示例7: SetData
public override void SetData(XtraReport report, string url)
{
// Change Report Display Name when Saving. So users know what file each report tab represents
report.DisplayName = Path.GetFileNameWithoutExtension(url);
base.SetData(report, url);
}
开发者ID:GeniusCode,项目名称:GeniusCode.XtraReports.Designer,代码行数:7,代码来源:CustomRootDirectoryStorageExtension.cs
示例8: PopulateHeaderLabels
public static void PopulateHeaderLabels(XtraReport report, params string[] captions)
{
var pageHeaderBand = report.FindControl(ReportHeaderBandName, true);
if (pageHeaderBand != null)
{
var header = pageHeaderBand.Controls.OfType<XRLabel>().FirstOrDefault(label => label.Name == ReportNameLabel);
if (header != null)
{
header.CanShrink = true;
header.Text = captions[0];
}
header = pageHeaderBand.Controls.OfType<XRLabel>().FirstOrDefault(label => label.Name == DataFilterLabel);
if (header != null)
{
string caption = (String.IsNullOrEmpty(captions[1]) == false) ?
String.Format("({0})", captions[1]) : String.Empty;
header.CanShrink = true;
header.Text = caption;
}
header = pageHeaderBand.Controls.OfType<XRLabel>().FirstOrDefault(label => label.Name == GridFilterLabel);
if (header != null)
{
string caption = (String.IsNullOrEmpty(captions[2]) == false) ?
String.Format("({0})", captions[2]) : String.Empty;
header.CanShrink = true;
header.Text = caption;
}
}
}
示例9: PrintDialog
public void PrintDialog(string operation)
{
if (string.IsNullOrEmpty(biEditTemplet.Caption))
{
MessageBox.Show(@"请先在 维护中心-模板管理,添加仓位标签项,再打开此界面!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
var dt = new DataKis.StockPlacePrintDataTable();
foreach (var uRow in uGridCheck.Rows.GetFilteredInNonGroupByRows())
{
var nRow = dt.NewStockPlacePrintRow();
nRow.FSPID = int.Parse(uRow.Cells["FSPID"].Value.ToString());
nRow.FNumber = uRow.Cells["FNumber"].Value.ToString();
nRow.FName = uRow.Cells["FName"].Value.ToString();
nRow.FFullName = uRow.Cells["FFullName"].Value.ToString();
dt.Rows.Add(nRow);
}
if (dt.Rows.Count < 1)
{
MessageBox.Show(@"请先筛选要打印的数据!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
var xtreport = new XtraReport();
// _btApp = new BarTender.Application();
//判断当前打印模版路径是否存在
var temPath = _cTempletFileName; //_cTempletFileName; //Application.StartupPath + @"\Label\" + _cTempletFileName;
if (!File.Exists(temPath))
{
MessageBox.Show(@"当前路径下的打印模版文件不存在!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
xtreport.ShowDesigner();
return;
}
xtreport.LoadLayout(temPath);
xtreport.PrinterName = _cPrinter;
xtreport.RequestParameters = false;
xtreport.ShowPrintStatusDialog = false;
xtreport.ShowPrintMarginsWarning = false;
//模板赋值
xtreport.DataSource = dt;
//模板赋值
switch (operation)
{
case "print":
xtreport.Print();
break;
case "design":
xtreport.ShowDesigner();
break;
case "preview":
xtreport.ShowPreview();
break;
}
}
示例10: IterateCells
/// <summary>
/// Iterates alls XRTableCell and XRLabel cells in the given report
/// </summary>
/// <param name="report">The report to fix its RTL direction alignment</param>
private static void IterateCells(XtraReport report)
{
// Iterate all XRTableCells and fix them
MakeCellsRightToLeft(report, report.AllControls<XRTableCell>());
// Iterate all XRLabels and fix them
MakeCellsRightToLeft(report, report.AllControls<XRLabel>());
}
示例11: GivenASubreportExistsAsAFile
public void GivenASubreportExistsAsAFile()
{
_subReportFilePath = Helpers.GetNewTempFile() + ".repx";
Path.GetDirectoryName(_subReportFilePath).Should().NotBeNullOrEmpty();
var subReport = new XtraReport();
subReport.SaveLayout(_subReportFilePath);
File.Exists(_subReportFilePath).Should().BeTrue();
}
示例12: GenerateReport
public void GenerateReport(XtraReport r, IList list, Type aType)
{
r.DataSource = list;
InitBands(r);
if (list.Count == 0) return;
dsd = GenerateDataSourceDefinition(aType);
InitDetailsBasedOnXRLabel(r, dsd);
}
示例13: GivenReportBExistsWithSubreportReportC
public void GivenReportBExistsWithSubreportReportC()
{
_reportB = new XtraReportWithSubReportInDetailReport();
var band = (DetailReportBand)_reportB.Bands[BandKind.DetailReport];
band.DataMember = "DogToys";
_containerWithReportCInside = (XRSubreport)band.Bands[BandKind.Detail].Controls[0];
_reportC = new XtraReport();
}
开发者ID:GeniusCode,项目名称:GeniusCode.XtraReports.Designer,代码行数:9,代码来源:Passing_datasources_at_design_time_through_2_nested_subreports.cs
示例14: PDFActionResult
public PDFActionResult(XtraReport report)
{
using (MemoryStream stream = new MemoryStream())
{
report.CreateDocument();
report.ExportToPdf(stream);
_byteArray = stream.ToArray();
}
}
示例15: Should_apply_actions_to_entire_report
public void Should_apply_actions_to_entire_report()
{
var color = Color.Green;
var action = new ReportControlAction<XtraReport>(r => true, r => r.BackColor = color);
var report = new XtraReport();
var newReport = new ReportController(new EventAggregator(), report, new ReportControlActionFacade(action)).Print(r => r.ExportToMemory());
Assert.AreEqual(color, newReport.BackColor);
}