I need to hide some columns during the exporting process, so that this columns are not exported to the excel sheet anymore. Workbook; if hWorkbook! But does not suppress the column with the index 0 in the excel sheet. It looks like that the Worksheet is only prepared and not filled in with any data at this event. Column; if hCol.
|Published (Last):||14 November 2013|
|PDF File Size:||10.82 Mb|
|ePub File Size:||14.89 Mb|
|Price:||Free* [*Free Regsitration Required]|
WorkbookFormat workbookFormat. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the. Text Imports System. IO Imports Infragistics.
Excel Imports Infragistics. Win Imports Infragistics. UltraWinGrid Imports Infragistics. Object, ByVal e As System. EventArgs Handles Button1. Export Infragistics. Excel97To, "ErrorLog.
New Me. Create, FileAccess. AddHandler excelExporter. FormulaExporting, AddressOf Me. FormulaExported, AddressOf Me. InitializeSummary, AddressOf Me. Export Me. Close Me. Dispose End If end try Return Me.
Key, e. ExcelFormatStr, e. FrameworkFormatStr ' Write the log entry Me. GridFormula, e. WorksheetCell, e.
Context ' Write the log entry Me. CancelAll ' Don't try to write out potentially invalid formulas e. ExcelFormula, e.
Error, e. ErrorText Me. NewLine If Not Me. GetBytes s Me. Write bytes, 0, bytes. C Copy Code using System; using System. Text; using System. IO; using Infragistics. Excel; using Infragistics. Win; using Infragistics. UltraWinGrid; using Infragistics. Export this. Close ; this.
ErrorText ; this. NewLine ; if this. GetBytes s ; this. All rights reserved. WorkbookFormat workbookFormat Parameters grid Grid to export. Return Value Created Infragistics.
Export WinGrid to a New PDF Document
I use Windows Forms Pack Export dgReport, report ; gridSection. Landscape; gridSection. AddText 0, 0 ; headerText. I made some changes to the code and wrapped it up in a small project. Please take a look at it and let me know if you have any questions, I will be glad to assist you further on this.
Export Grid Data to Excel
It is highly unlikely that your grid will be in perfect form for a printable document such as a PDF file. Some important events covered in this walkthrough are listed below:. BeginExport — Fires when the entire exporting process first begins. This is where you would set Section-specific properties and modify the ExportLayout by hiding a few columns. The ExportLayout is the layout of the exported grid, just as the DisplayLayout is the layout of the on-screen grid.