using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;
using System.IO;
namespace FastReport
{
public class ReportScript
{
private void Text81_AfterData(object sender, EventArgs e)
{ /* 调试报表时,可以注释掉该事件中的语句,可以正常预览,调试完成记得切换回来!!! */
var lts=Convert.ToString(Report.GetParameterValue("LTS"));
if(lts=="Y")
{
(PResLis.FindObject("Text81") as TextObject).Visible=false;
}
else
{
(PResLis.FindObject("Text81") as TextObject).Visible=true;
}
}
private void Text73_BeforePrint(object sender, EventArgs e)
{
var backColorNum=Convert.ToInt32(Report.GetColumnValue("res.reportBackgroundColor"));
var fontColorNum=Convert.ToInt32(Report.GetColumnValue("res.reportFontColor"));
var status=(PResLis.FindObject("Text73") as TextObject).Text;
if(backColorNum>0)
{
Color backColor=Color.FromArgb(backColorNum);
Color fontColor=Color.FromArgb(fontColorNum);
int r,g,b;
r=backColor.R;
g=backColor.G;
b=backColor.B;
(sender as TextObject).Fill=new SolidFill(Color.FromArgb(r,g,b));
r=fontColor.R;
g=fontColor.G;
b=fontColor.B;
(sender as TextObject).TextFill=new SolidFill(Color.FromArgb(r,g,b));
}
}
private void _StartReport(object sender, EventArgs e)
{
string summaryContent=((String)Report.GetColumnValue("summContent.summaryContent"));
string suggestionTitle=((String)Report.GetColumnValue("sug.suggestionTitle"));
if(!String.IsNullOrEmpty(summaryContent) && !String.IsNullOrEmpty(suggestionTitle)){
PsumAsug.Visible=true;
}
else{
PsumAsug.Visible=false;
}
string asbItemTypeId=((String)Report.GetColumnValue("resAsbitem.itemTypeId"));
if(!String.IsNullOrEmpty(asbItemTypeId)){
PAsbitem.Visible=true;
} else{
PAsbitem.Visible=false;
}
string lisMedicalReportTypeId= ((String)Report.GetColumnValue("dictNotExamItemType.medicalReportTypeId"));
if(!String.IsNullOrEmpty(lisMedicalReportTypeId)){
PResLis.Visible=true;
} else{
PResLis.Visible=false;
}
string pacsItemTypeId=((String)Report.GetColumnValue("dictExamItemType.itemTypeId"));
if(!String.IsNullOrEmpty(pacsItemTypeId)){
PResPacs.Visible=true;
} else{
PResPacs.Visible=false;
}
string picAsbitemNames=((String)Report.GetColumnValue("resPic.asbitemNames"));
if(!String.IsNullOrEmpty(picAsbitemNames)){
PPicture.Visible=true;
} else{
PPicture.Visible=false;
}
}
private void Barcode1_BeforePrint(object sender, EventArgs e)
{
Barcode128 b128=new Barcode128();
Barcode1.Barcode=b128;
Barcode1.Text=((String)Report.GetColumnValue("pinfo.patientRegisterNo"));
}
}
}