Hi there,
I am currently using Infragistics4.Web.v12.2, Version=12.2.20122.2054.
I want to export a webdatagrid to a word document, with my custom css style classes applied.
I can export the grid successfully and I have set the wordExporter.EnableStylesExport = True in the code behind.
I also handle the webWordExporter.RowExported event. Should the styles be applied during the Exporting event?
However, the grid only exports with the default IG stylesheet.
Am I missing something, or is this currently supported?
Regards.
Hello,
I want to let you know that I have received your questions here and will be looking into this for you. I will have an update for you on this post on or before Tuesday.
Thanks!
Hi JJB,
When setting EnableStylesExport to 'true' the styles that are applied to the grid when exporting to MS Word should export as well. I have tested this and find that this is not working as expected. I have logged this with our engineers with a development issue id #137968.
JJB, I have created a private support case for you for further follow-up details.
Thanks for reporting this.
Where would I find the status of the development issue #137968? I'm experiencing the same issue with the grid style not exporting. We have css applied to the grid and also at the InitializeRow event. The row will highlight in yellow when the data meets a certain criteria. When I have EnableStylesExport set to true, it only exports the grid's css without the rows highlighted in yellow. Any thoughts?
Thanks,
Karen
Hi Karen,
As it turns out, this was not a development issue after all. All that is needed for the styles to be exported to MS Word, is to apply the runat="server" setting within the style tag.
I attached my sample for your reference.
Please note that I omitted the style sheets due to file size constraints. For proper styling of the grid you will need to bring the ig_res folder back into the project. You can do this by opening the project in the designer and select 'OK' when prompted to accept the sytle sheets.
This is to document for the benefit of the Infragistics Community, that this has been submitted as a Development Issue with id #140462. Our engineers are looking at this issue and I will update you once their review has completed.
Thank you Karen!
Hi Alan,
No, I don't have a demo at this time. When I EnableStylesExport, it does export the css that tied to the grid (within ig_res), but leaves out the custom styling applied on InitializeRow. So the header, text and alternate row styles get exported but it leaves out the rest.
Karen,
Do you have an example that shows this not working that is using styles in the same way that you are in your application that we can look at and see what is happening?
Hi Troy,
I didn't realize until this morning that this thread was regarding exporting to MS Word. I thought it was the export to Excel. I still tried what you suggested, but it doesn't work. I have a workaround for applying yellow background to a row within the RowExporting event. I added a hidden column that holds a true/false value that indicates whether or not to apply the style. But I also need to apply specific styling to an individual cell and I'm having issues with that. Is there another forum post that you're aware of addressing the styling when exporting to Excel? I have yet to find one that resolves the issue.
Hi Tom,
Your case is actively being looked into and will responded to on the support case. Thank you for your patience as we research your matter further.