回复 12楼mjq的帖子
我现在也不清楚什么时候会发布维护版本。
目前没有公开的方法能解决这个问题,如果你着急的话可以先试试反射,不过这只是临时解决方案,用了产品的私有成员,等正式维护版本发布以后请删除这段代码。
在 ExportController 中,有个方法叫 Post,把 Post 方法的前面改成:
public async Task<HttpResponseMessage> Post()
{
SpreadExportParam exportParam = GetExportParm();
MemoryStream stream = new MemoryStream();
Exporter exporter = new Exporter(exportParam.Spread);
System.Reflection.FieldInfo modelFiled = exporter.GetType().GetFields(System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)[0];
GrapeCity.Spread.Sheets.ExcelIO.Spread model = modelFiled.GetValue(exporter) as GrapeCity.Spread.Sheets.ExcelIO.Spread;
System.Reflection.PropertyInfo[] properties = model.GetType().GetProperties(System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
foreach(var property in properties)
{
if (property.PropertyType == typeof(Workbook))
{
Workbook workbook = property.GetValue(model, new object[] { }) as Workbook;
foreach (var workSheet in workbook.Sheets)
{
workSheet.PrintInfo.ShowBorder = false;
}
}
}
this.export(exporter, exportParam, stream); |