Infragistics excel

Posted by jmls on 21-Jun-2010 01:26

Perhaps I'm missing something obvious, but how do you go about adding this control to your form ? I can't find it in the toolbox, and when I try to add it, it complains about "there are no components in the assembly to add to the toolbox"

Julian

All Replies

Posted by Wouter Dupré on 21-Jun-2010 01:43

Hi, I'm out of the office for business. During my absence I will have no or limited access to my e-mail.

For immediate assistance please call our office at +32 (0) 15 30 77 00.

Best regards,

Wouter.

--

Wouter Dupré

Senior Solution Consultant

Progress Software NV

Stocletlaan 202 B| B-2570 Duffel | Belgium

Direct Line +32 (0) 15 30 77 00 | Mobile +32 (0) 478 50 00 49

wdupre@progress.com

Posted by Roger Blanchard on 22-Jun-2010 13:57

Julian,

There are two Infragistics controls that deal with excel. The first one is the UltraGridExcelExporter and you can drop that on a form and then use it to export the contents of an UltraGrid to excel with code similar to the following:

ultraGridExcelExporter1:EXPORT(grid, cOutfile).

The second one is the Infragistics.Excel namespace that you can use to create your own Excel workbook with code similar to the following.

USING Infragistics.Excel.*.

DEFINE

VARIABLE oWorkbook AS CLASS Infragistics.Excel.Workbook NO-UNDO.

DEFINE

VARIABLE oWorksheet AS CLASS Infragistics.Excel.Worksheet NO-UNDO.

/* let's create our excel workbook object */

oWorkbook =

NEW Workbook(). /* if this fails the CATCH BLOCK will set opcException and return error to UI */

/*oWorkbook:SetCurrentFormat(Infragistics.Excel.WorkbookFormat:Excel2007).*/

/* let's set some document properties */

ASSIGN

oWorkbook:DocumentProperties:Author =

"Roger Blanchard"

oWorkbook:DocumentProperties:Company =

"Osprey Retail Systems, Inc."

oWorkbook:DocumentProperties:

Title = "Excel Financials Report"

oWorkbook:DocumentProperties:Comments = cComments

.

/* if we wanted to set some WindowOptions we would do something like the following */

ASSIGN

oWorkbook:WindowOptions:TabBarVisible =

TRUE

oWorkbook:WindowOptions:FirstVisibleTabIndex =

0

.

/* now let's create a worksheet and give it a name */

oWorksheet = oWorkbook:Worksheets:

Add("Stores").

/* let's manipulate some DisplayOptions for the Worksheet */

ASSIGN

oWorksheet:DisplayOptions:MagnificationInNormalView =

100

oWorksheet:DisplayOptions:ShowGridlines =

TRUE

oWorksheet:DisplayOptions:PanesAreFrozen =

TRUE /* this will freeze rows/columns so they are always in view */

oWorksheet:DisplayOptions:FrozenPaneSettings:FrozenRows =

1 /* let's freeze one row at the top */

oWorksheet:DisplayOptions:FrozenPaneSettings:FrozenColumns =

1 /* let's freeze one column on the left */

.

/* let's setup our PrintOptions for the Worksheet */

ASSIGN

oWorksheet:PrintOptions:

Orientation = Infragistics.Excel.Orientation:LANDSCAPE

oWorksheet:PrintOptions:HeaderMargin = .

25

oWorksheet:PrintOptions:FooterMargin = .

25

oWorksheet:PrintOptions:TopMargin =

1.0

oWorksheet:PrintOptions:BottomMargin = .

75

oWorksheet:PrintOptions:LeftMargin = .

75

oWorksheet:PrintOptions:RightMargin = .

75

/* We will use section commands to place the header in the proper section */

oWorksheet:PrintOptions:

Header = "&LDate: &D Time: &T" + CHR(13) + "Report Period: " + ttblReportParams.PeriodDesc + CHR(13) + "Date Range: " + STRING (dtStartRptDate) + " - " + STRING (dtEndRptDate) +

"&C" + cBusinessName + CHR(13) + cReportTitle +

"&R" + "Report Number: " + STRING(iReportNum) + CHR(13) + "Page &P of &N"

oWorksheet:PrintOptions:PrintRowAndColumnHeaders =

FALSE

oWorksheet:PrintOptions:MaxPagesHorizontally =

1 /* force sheet on 1 page wide */

oWorksheet:PrintOptions:MaxPagesVertically =

1 /* force sheet on 1 page high */

oWorksheet:PrintOptions:Footer =

""

oWorksheet:PrintOptions:PrintGridlines =

FALSE

.

This thread is closed