本文整理汇总了C#中XtraReport类的典型用法代码示例。如果您正苦于以下问题:C# XtraReport类的具体用法?C# XtraReport怎么用?C# XtraReport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XtraReport类属于命名空间,在下文中一共展示了XtraReport类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}}
开发者ID:gipasoft,项目名称:Sfera,代码行数:30,代码来源:PianoRatealeSubreport.cs
示例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);
}
开发者ID:paulute,项目名称:eXpand,代码行数:7,代码来源:ReportData_EF.cs
示例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;
}
}
}
开发者ID:5509850,项目名称:baumax,代码行数:34,代码来源:WeeklyPlanningPrintController.cs
示例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);
}
开发者ID:GeniusCode,项目名称:GeniusCode.XtraReports.Runtime,代码行数:27,代码来源:General_scenarios.cs
示例5: SaveReport
public override void SaveReport(XtraReport report)
{
base.SaveReport(report);
CustomXafReport xafReport = (CustomXafReport)report;
this.ReportId = xafReport.ReportId;
this.ReportName = xafReport.ReportName;
}
开发者ID:kamchung322,项目名称:Namwah,代码行数:7,代码来源:CustomXafReport.cs
示例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");
}
开发者ID:GeniusCode,项目名称:GeniusCode.XtraReports.Runtime,代码行数:26,代码来源:General_scenarios.cs
示例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;
}
}
}
开发者ID:Rukhlov,项目名称:DataStudio,代码行数:30,代码来源:ReportCommonMethods.cs
示例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;
}
}
开发者ID:JARANTeam,项目名称:JWMSH,代码行数:60,代码来源:WorkStockPlaceLabelPrint.cs
示例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>());
}
开发者ID:RDF-Co,项目名称:RDF.Reports.DevX.15.1,代码行数:12,代码来源:XtraReportRTLTextFixer.cs
示例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();
}
开发者ID:JackWangCUMT,项目名称:XtraSubreportEngine,代码行数:8,代码来源:SubReportIsPassedCorrectDatasource.cs
示例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);
}
开发者ID:HoanChan,项目名称:QuanLyCuaHangBanXe,代码行数:8,代码来源:ReportBuilderHelper.cs
示例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();
}
}
开发者ID:emretiryaki,项目名称:Blog,代码行数:9,代码来源:PDFActionResult.cs
示例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);
}
开发者ID:GeniusCode,项目名称:GeniusCode.XtraReports.Runtime,代码行数:10,代码来源:General_scenarios.cs
示例16: Should_Dispose_visitors
public void Should_Dispose_visitors()
{
var view = new XtraReport {DataSource = new[] {new object(), new object()}};
var controllerA = new XRReportController(view);
var view2 = controllerA.Print(r => r.ExportToMemory());
GlobalXRSubscriber.Singleton.Visitors.Values.Count(wr => wr.IsAlive && ((XRRuntimeVisitor)wr.Target).ReportHashcode == view2.RootHashCode).Should().Be(1);
GC.Collect();
GlobalXRSubscriber.Singleton.Visitors.Values.Count(wr => wr.IsAlive && ((XRRuntimeVisitor)wr.Target).ReportHashcode == view2.RootHashCode).Should().Be(0);
}
开发者ID:JackWangCUMT,项目名称:XtraSubreportEngine,代码行数:10,代码来源:ApiTweaks.cs
示例17: InvokeAfter
public void InvokeAfter(XtraReport report, object customArgs)
{
report.Disposed += (s, e) =>
{
var rep = (XtraReport)report;
var dataSource = report.DataSource as IDisposable;
if (dataSource != null)
dataSource.Dispose();
report.DataSource = null;
};
}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:11,代码来源:ReportBuildInterceptor.cs
示例18: InitBands
public void InitBands(XtraReport rep)
{
DetailBand detail = new DetailBand();
PageHeaderBand pageHeader = new PageHeaderBand();
ReportFooterBand reportFooter = new ReportFooterBand();
detail.Height = 20;
reportFooter.Height = 380;
pageHeader.Height = 20;
rep.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { detail, pageHeader, reportFooter });
}
开发者ID:HoanChan,项目名称:QuanLyCuaHangBanXe,代码行数:11,代码来源:ReportBuilderHelper.cs
示例19: SetDataSource
public void SetDataSource(XtraReport document, ImpostazioneReportDTO impostazioneReportDTO)
{
_document = document;
if (_document.Pages.Count == 0)
{
_document.CreateDocument();
if (impostazioneReportDTO != null && impostazioneReportDTO.FitToPage)
_document.PrintingSystem.Document.AutoFitToPagesWidth = 1;
}
documentViewer1.DocumentSource = _document;
}
开发者ID:gipasoft,项目名称:Sfera,代码行数:11,代码来源:AnteprimaReportTemplate.cs
示例20: SetTextWatermark
public void SetTextWatermark(XtraReport report)
{
// Adjust text watermark settings.
report.Watermark.Text = "Not Origional";
report.Watermark.TextDirection = DirectionMode.ForwardDiagonal;
report.Watermark.Font = new Font("Arial Black", 50);
report.Watermark.ForeColor = Color.DarkRed;
report.Watermark.TextTransparency = 60;
report.Watermark.ShowBehind = true;
//report.Watermark.PageRange = "1,3-5";
}
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:11,代码来源:DocumentBrowser.cs
注:本文中的XtraReport类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论