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;
namespace FastReport
{
public class ReportScript
{
private void Cell4_BeforePrint(object sender, EventArgs e)
{
// cast the cell's value to decimal because [MatrixDemo.Revenue]
// data column is of System.Decimal type
decimal value = Cell4.Value == null ? 0 : (decimal)Cell4.Value;
// set shapes visibility: one shape if value < 100; two if < 3000; three if >= 3000
Shape1.Visible = true;
Shape2.Visible = value >= 100;
Shape3.Visible = value >= 3000;
// Highlight: red < 100; yellow < 3000; green >= 3000
Color color = Color.Red;
if (value >= 100)
color = Color.Yellow;
if (value >= 3000)
color = Color.GreenYellow;
Shape1.Fill = new SolidFill(color);
Shape2.Fill = new SolidFill(color);
Shape3.Fill = new SolidFill(color);
}
}
}
|