FastReport.NET2023-动态列报表自动隐藏列及调整标签宽度
C# 全选
/// <summary>
/// FastReport.NET 自动隐藏列及调整标签宽度
/// </summary>
/// <param name="report"></param>
private void HideColumn(Report report)
{
//找出组件
var price1 = report.FindObject("Text70") as TextObject;
var price2 = report.FindObject("Text81") as TextObject;
var price3 = report.FindObject("Text94") as TextObject;
//隐藏组件
price1.Visible = false;
price2.Visible = false;
price3.Visible = false;
//其他列自动补位,调整左边距、宽度补位
var qty1 = report.FindObject("Text69") as TextObject;
var qty2 = report.FindObject("Text72") as TextObject;
var qty3 = report.FindObject("Text78") as TextObject;
//调整左边距
qty1.Left = 15.12f;
qty2.Left = 15.12f;
qty3.Left = 15.12f;
//调整宽度
qty1.Width = 20.21f;
qty2.Width = 20.21f;
qty3.Width = 20.21f;
}
报表完整列
隐藏列,并自动调整列位置
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网