0% found this document useful (0 votes)
55 views2 pages

Stylos FastReport

The document contains code for changing styles and visibility of different object types like shapes, lines, and text in a report. It includes functions for removing styles, changing styles based on object name prefixes, and alternating row colors in a detail section. Style names are concatenated with a passed string parameter to allow dynamic styling.

Uploaded by

Duvier ZP
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views2 pages

Stylos FastReport

The document contains code for changing styles and visibility of different object types like shapes, lines, and text in a report. It includes functions for removing styles, changing styles based on object name prefixes, and alternating row colors in a detail section. Style names are concatenated with a passed string parameter to allow dynamic styling.

Uploaded by

Duvier ZP
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

private void quitarEstilos(/*ObjectCollection Objectos*/) {

foreach (Base item in Report.AllObjects) {

//ShapeObject
if (item is ShapeObject)
((ShapeObject)item).Visible = false;

//LineObject
if (item is LineObject)
((LineObject)item).Visible = false;

//TextObject
if (item is TextObject)
((TextObject)item).Style = "Compania_Estilo1";

//PictureObject
if (item is PictureObject)
((PictureObject)item).Visible = false;

}
}

private void cambiarEstilos(string style) {


foreach (Base item in Report.AllObjects) {

/*TextObject*/
if (item is TextObject) {

if (item.Name.StartsWith("l")) {
((TextObject)item).Style = "CabeceraBlanco_Estilo" + style;
} else if (item.Name. StartsWith("d")) {
((TextObject)item).Style = "DetalleLetras_Estilo" + style;
} else if (item.Name.StartsWith("FondoCabecera")) {
((TextObject)item).Style = "CabeceraColor_Estilo" + style;
} else if (item.Name.StartsWith("BarraF")) {
((TextObject)item).Style = "CabeceraColor_Estilo" + style;
} else if (item.Name.StartsWith("EstiloDetalle")) {
((TextObject)item).Style = "DetalleColor_Estilo" + style;
}else if (item.Name.StartsWith("t")) {
((TextObject)item).Style = "Totales_Estilo" + style;
}else if (item.Name.StartsWith("Sum")) {
((TextObject)item).Style = "Totales_Estilo" + style;
}else if (item.Name.StartsWith("TituloReporte")) {
((TextObject)item).Style = "Titulo_Estilo" + style;
}else if (item.Name. StartsWith("Rtf")) {
((TextObject)item).Style = "DetalleLetras_Estilo" + style;
}
}
}

Marco.Style = "MarcoCabecera_Estilo" + style;


// DatosImpresion.Style= "DatosImpresion_Estilo" + style;
Compania.Style= "Compania_Estilo" + style;
TituloReporte.Style= "Titulo_Estilo" + style;
if( style=="1") {
LineaCabecera.Border.LeftLine.Width =(float)1;
}else{
if(style =="4") {
LineaCabecera.Visible =false;
}else{
LineaCabecera.Border.LeftLine.Width =(float)2;
}
}
}

//Este metodo se usa para cambiar el color del detalle


private void ImprimirDetalle(string style,int Col) {
if (Col % 2 == 0) {
Barra.Style = "DetalleColor_Estilo" + style;
}else{
Barra.Style = "DetalleBlanco_Estilo" + style;
}
}

private void _StartReport(object sender, EventArgs e)


{

cambiarEstilos(((String)Report.GetParameterValue("EstiloReporte")));
}

private void MasterData1_BeforePrint(object sender, EventArgs e)


{
ImprimirDetalle(((String)Report.GetParameterValue("EstiloReporte")),
((Int32)Report.GetVariableValue("Row#")));
}

You might also like