1.
Devexpress. xtrareports: xrw.tgridDisplay timeFormat of "0:
Change the summarytype of xrw.tgridfield1 to "Max" or "min ";
In addition, when the cell formatting time is displayed together with the default date and time,
If you only want to displayTime(Do not display the date Department) you only need to set cellformat in the xrw.tgridfield1 attribute to datetime "T"
If you only want to displayDate(Do not display the time part) you only need to set cellformat in the xrw.tgridfield1 attribute to datetime "D"
The following settings only affectGrandtotal(Total), does not affect Subtotal
This. Repeated tgridfield12.grandtotalcellformat. formatstring = "T ";
This. Repeated tgridfield12.grandtotalcellformat. formattype = devexpress. utils. formattype. datetime;
2.
// This. xrw.tgrid1.optionsview. showcolumnheaders = false; // display the column header
This. xrw.tgrid1.optionsview. showdataheaders = false; // display the data header
This. xrw.tgrid1.optionsview. showcolumntotals = false; // display the subtotal of a horizontal group
// This. xrw.tgrid1.optionsview. showcolumngrandtotals = false; // display the horizontal total
This. xrw.tgrid1.optionsview. showrowgrandtotals = false; // display the vertical total
// xrw.tgrid1.showcolumngrandtotalheader = false; // The horizontal total table header text ("Grand total")
This. xreffectgridfield5.options. showgrandtotal = false;// Do not display the total
This. xrw.tgridfield6.options. showtotal = false;// Do not display Subtotal
3.Add a custom total column (not tested)
If (Xrw.tgridfield5.area = Pivotarea. columnarea)
{
Xrw.tgridfield5.customtotals. Clear ();
Xreffectgridfield5.customtotals. Add (devexpress. Data. effectgrid. effectsummarytype. Average );
Xreffectgridfield5.customtotals. Add (devexpress. Data. effectgrid. effectsummarytype. max );
Xrw.tgridfield5.totalsvisibility = Pivottotalsvisibility. customtotals;
}
4.Alignment mode (here, javastgridcontrol uses the winform Control)
// Other cell alignment methods are similar.
This. Adjust tgridcontrol2.appearance. fieldvaluetotal. textoptions. halignment = devexpress. utils. horzarignment. Center; // align the subtotal title in the center
This. Adjust tgridcontrol2.appearance. fieldvaluegrandtotal. textoptions. halignment = devexpress. utils. horzarignment. Center; // align the total title in the center
This. Adjust tgridcontrol2.appearance. fieldvalue. textoptions. halignment = devexpress. utils. horzarignment. Center; // The Field column is centered and aligned.
5. // Modify the statistics title
Private void effectgridcontrol2_fieldvaluedisplaytext (Object sender, devexpress. xtrapivotgrid. effectfielddisplaytexteventargs E)
{
If (E. valuetype = devexpress. xtrapivotgrid. effectgridvaluetype. grandtotal) // total
{
If (E. iscolumn & E. displaytext. Trim () = "Grand total") // The total title of the first-level column
{
E. displaytext = "Total ";
} Else
If (E. iscolumn) // other layer columns total title
{
E. displaytext = E. displaytext + "Total ";
}
Else if (E. iscolumn = false & E. displaytext. Trim () = "Grand total") // The total title of the first row
{
E. displaytext = "Total ";
}
Else // This does not seem to happen
{
E. displaytext = "";
}
}
Else if (E. valuetype ==devexpress. xtrapivotgrid. effectgridvaluetype. Total) // Subtotal
{
If (E. iscolumn & E. value! = NULL) // the title of the first-level column Subtotal
{
// E. displaytext = E. displaytext. Replace ("Total", ""). Trim () + "subtotal ";
E. displaytext = E. Value + "subtotal ";
}
Else if (E. iscolumn) // subtotal title for other layer Columns
{
E. displaytext = E. displaytext. Replace ("Total", ""). Trim () + "Total ";
}
}
Else if (E. valuetype ==devexpress. xtrapivotgrid. effectgridvaluetype. customtotal) // other custom aggregate types
{
}
}