Hi
I want a small clarification on one of the use case related to Excel Library.
I'm trying to Export the IgrDataGrid and using the following code for that. I'm able to Export the grid but facing issue on styling.
I want to know that
1 - How to set Chip Styling on specific Cell while Exporting.
2 - How to set the color for specific cell.
3 - How to set the background color for row.
So, for this I need to know how can we achieve that , If there is any solution for this please suggest as I need to implement this.
Hoping for a positive response.
Thanks!!!
Hello Shubham,
I have been investigating into the behavior you are looking to achieve in this case, and I have some information for you on this matter. I will address each inquiry below:
1. I’m not sure I understand what you mean by “Chip Styling” in this case? Would it be possible for you to please provide a screenshot or more description on what you are looking for here?
2 & 3. There is a cellFormat property on both the WorksheetCell and WorksheetRow object which then exposes a fill property that you can set for this. Using your code above, the following would allow you to color the entire row:
row.cellFormat.fill = CellFill.createSolidFill("red");
The same code would work for individual cells, as the cells expose the cellFormat property as well.
Please let me know if you have any other questions or concerns on this matter.
Hello Andrew,
Thank you for your response.
I have provided the screenshot below, this kind of chip style we are looking for.
For Column1
For Column2
Let me know if some other information is required from our end.
Thanks.
I am attaching a sample that uses a Rectangle shape type to create a “chip-like” display in the header of an IgrDataGrid Excel Export. I hope this helps you.
operations-on-workbooks.zip
Can you please provide the small working sample for this, It will be really helpful for us.
From your most recent update, I am under the impression that you are trying to export the IgrChip elements to Excel or have something that looks like them in the cells.
There is no support for “Chips” in the Ignite UI for React Excel Library, as I do not believe there is anything in Excel that would be able to translate over to this type of look. The closest thing I can recommend to your first point is the ability to add shapes to the worksheet at the moment via its shapes collection. For example, you could add a line to one of the cells like so:
let row: WorksheetRow = ws.rows(0);
let topLeftCell: WorksheetCell = row.cells(0); let bottomRightCell: WorksheetCell = row.cells(0);
let point1: IgPoint = {x: 0, y: 0}; let point2: IgPoint = {x: 100, y: 100};
let shape: WorksheetShape = ws.shapes().add(PredefinedShapeType.Line, topLeftCell, point1, bottomRightCell, point2);
Perhaps using these shapes could give you a visualization like the one you are looking for in Excel, but the issue in this case is that the shapes will have no collision detection with the text in the cells by default, so you could end up with a line going through your text if you use the above.
If you would like to see the ability to export Chip Styles or something of the like to Excel, I would recommend suggesting a new feature request for this at our Ignite UI for React GitHub page, here: https://github.com/igniteui/igniteui-react/issues. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.