Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » ReportGrid Prof-uis version -2.64 Collapse All
Subject Author Date
Nan dhini May 24, 2007 - 3:53 AM

Hi,
    i’m using reportgrid in my Project.i want to send both datas and their header
names to excelsheet.but i didn’t send the grid header to excel sheet.i sent datas only.
How to send the grid header values to excel sheet.Plese help me........



Thanks and Regards,
Nandhini





    

Nan dhini May 27, 2007 - 11:59 PM

ok.But in Tree view i couldn’t take header values.For example,I have put two of the grid columns in tree view.Remaining grid columns are exported to excel sheet.but i want all the columns to export the excel.(including Tree view header).Awaiting u’r reply .thanking you.



Regards,
Nandhini

Technical Support May 29, 2007 - 1:06 PM

Let’s sort it out. We assume you have a manually coded procedure for exporting grid content to Excel. And you need to know how retrieve the column header text to export it along with the data cells. As we said earlier each header cell is a CExtReportGridColumn object. The CExtReportGridColumn class is derived from CExtGridCellHeader. So you can use the TextGet() method to retrieve the column name. There is also a handy CExtReportGridColumn::ColumnNameGet() method. So the question that is left is how to retrieve the corresponding CExtReportGridColumn objects and we already provided you with an answer: if you want to get all the visible(active) and/or invisible(inactive) columns in the report grid, you should enumerate them using the CExtReportGridWnd::ReportColumnGetStartPosition() and CExtReportGridWnd::ReportColumnGetNext() methods.

You can see how the export works in the ReportGrid sample. Select some rows and go to File->Export To Excel menu item. The corresponding procedure is called CChildView::OnRgExportToExcel().

Technical Support May 26, 2007 - 11:22 AM

If you want to get visible header cells only, you should get the number of visible header cells using the CExtGridWnd::ColumnCountGet() method and get each of the header cells using CExtGridWnd::GridCellGetOuterAtTop(). Each header cell is a CExtReportGridColumn object.

If you want to get all the visible(active) and/or invisible(inactive) columns in the report grid, you should enumerate them using the CExtReportGridWnd::ReportColumnGetStartPosition() and CExtReportGridWnd::ReportColumnGetNext() methods.