52 lines
1.4 KiB
C#
52 lines
1.4 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Globalization;
|
|
using DevExpress.XtraReports.UI;
|
|
using BeWo.Report.ReportObjects;
|
|
using BS.Shared.DataContracts;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using BeWo.Report;
|
|
|
|
namespace InputFamilienhilfe
|
|
{
|
|
public partial class Punktebogen : XtraReport, IBeWoReport<AssessmentSheetRO>
|
|
{
|
|
public Punktebogen()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(AssessmentSheetRO pRO)
|
|
{
|
|
bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
private void Cell_EvaluateBinding(object sender, BindingEventArgs e)
|
|
{
|
|
var cell = sender as XRTableCell;
|
|
|
|
|
|
var sv = e.Value as SheetValue;
|
|
if (sv != null && !String.IsNullOrEmpty(sv.Color))
|
|
{
|
|
int argb = Int32.Parse(sv.Color.Replace("#", ""), NumberStyles.HexNumber);
|
|
Color clr = Color.FromArgb(argb);
|
|
|
|
cell.BackColor = clr;
|
|
}
|
|
else
|
|
{
|
|
cell.BackColor = Color.Transparent;
|
|
}
|
|
}
|
|
|
|
private void tc_color_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
|
|
{
|
|
var tc = sender as XRTableCell;
|
|
tc.BackColor = ColorTranslator.FromHtml(tc.Text);
|
|
tc.ForeColor = tc.BackColor;
|
|
}
|
|
}
|
|
}
|