dev的report计算字符串实际width
本帖最后由 老鱼1996 于 2019-1-23 00:47 编辑private float getWidth(XRControl xr)
{
float actualWidth = BrickGraphics.MeasureString(xr.Text, xr.GetEffectiveFont(), 0, (StringFormat)StringFormat.GenericTypographic.Clone(), GraphicsUnit.Document).Width;
switch (this.ReportUnit)
{
case ReportUnit.HundredthsOfAnInch:
actualWidth = GraphicsUnitConverter.Convert(actualWidth, GraphicsUnit.Document, GraphicsUnit.Inch) * 100;
break;
case ReportUnit.TenthsOfAMillimeter:
actualWidth = GraphicsUnitConverter.Convert(actualWidth, GraphicsUnit.Document, GraphicsUnit.Millimeter) * 10;
break;
case ReportUnit.Pixels:
actualWidth = GraphicsUnitConverter.Convert(actualWidth, GraphicsUnit.Document, GraphicsUnit.Pixel);
break;
}
return actualWidth;
}
那么问题来了,给一个宽怎么算一行能显示多少字?
页:
[1]