Change the font type in XtraReport of DevExpress

0

How can I change the font type in a specific record, regardless of the size or style of the font?

Example:

  1101 Caja y Banco     10,000.00 esto lo quiero en negrita
110101                   5,000.00
110102                   5,000.00 estos dos últimos en letras normales
    
asked by Donald A. Ramirez 02.01.2018 в 19:38
source

1 answer

0

If the font size depends on the registry value, use the event BeforePrint :

An idea would be more or less like this:

using System;
using System.Drawing;
using DevExpress.XtraReports.UI;
// ...

private void Control_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
    decimal valor = GetCurrentColumnValue<decimal>("valor");
    Font fuente = null;
    switch(valor) {
        case 1:
        //fuente 1
        break;
        case 2:
        //fuente 2
        break;
        //etc.
    }
    XRControl control = (XRControl) sender;
    control.Font = fuente;
}
    
answered by 24.02.2018 в 14:20