Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParameterRenderer的cell修改style后,所有cell都运用了该样式 #21

Open
pigwing opened this issue Feb 6, 2020 · 1 comment
Open

Comments

@pigwing
Copy link

pigwing commented Feb 6, 2020

public override void Render(SheetContext sheetContext, T dataSource)后
Cell cell = sheetContext.GetCell(location) as Cell;
cell.NpoiCell.CellStyle.FillForegroundColor = HSSFColor.Red.Index;
cell.NpoiCell.CellStyle.FillPattern = FillPattern.SolidForeground;
对cell设置底色,但是没设置底色的cell也跟这个设置了底色的cell一样底色了.

@ivwsdnvpynn
Copy link

public override void Render(SheetContext sheetContext, T dataSource)后
Cell cell = sheetContext.GetCell(location) as Cell;
cell.NpoiCell.CellStyle.FillForegroundColor = HSSFColor.Red.Index;
cell.NpoiCell.CellStyle.FillPattern = FillPattern.SolidForeground;
对cell设置底色,但是没设置底色的cell也跟这个设置了底色的cell一样底色了.

传入workbook 进来可以实现
ICellStyle style = sheetContext.Workbook.NpoiWorkbook.CreateCellStyle();
style.Alignment = HorizontalAlignment.Right;

                cell.NpoiCell.CellStyle = style;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants