71 lines
2.1 KiB
C#
71 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Text.RegularExpressions;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using BS.Shared.Core;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace JusinaJugendhilfe.Reporting
|
|
{
|
|
public partial class Taetigkeitsnachweis : XtraReport, IBeWoReport<ServicesOverviewRO>
|
|
{
|
|
private int _rowCounter = 0;
|
|
|
|
public Taetigkeitsnachweis()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServicesOverviewRO pRO)
|
|
{
|
|
_rowCounter = 0;
|
|
|
|
if (pRO.Costbearer.Contains("Stadt Bocholt"))
|
|
{
|
|
pbCustomerUnterschrift.Visible = true;
|
|
lblUnterschriftKlient.Visible = true;
|
|
lblCustomerUnterschrift.Visible = true;
|
|
}
|
|
|
|
bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
private void Detail1_BeforePrint(object sender, System.ComponentModel.CancelEventArgs e)
|
|
{
|
|
_rowCounter++;
|
|
xrTableCell7.Text = _rowCounter.ToString();
|
|
}
|
|
|
|
private void picSignature_BeforePrint(object sender, System.ComponentModel.CancelEventArgs e)
|
|
{
|
|
XRPictureBox xrBox = sender as XRPictureBox;
|
|
//var test = this.GetCurrent
|
|
string base64String = xrBox.Tag as string;
|
|
if (!String.IsNullOrWhiteSpace(base64String))
|
|
{
|
|
var base64Data = Regex.Match(base64String, @"data:image/(?<type>.+?),(?<data>.+)").Groups["data"].Value;
|
|
var binData = Convert.FromBase64String(base64Data);
|
|
Image img = ByteArrayToImage(binData);
|
|
xrBox.Image = Utils.CropImage(img);
|
|
}
|
|
else
|
|
{
|
|
xrBox.Image = null;
|
|
}
|
|
}
|
|
|
|
public Image ByteArrayToImage(byte[] byteArrayIn)
|
|
{
|
|
using (var memoryStream = new MemoryStream(byteArrayIn))
|
|
{
|
|
return Image.FromStream(memoryStream);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|