Hello Charmaine,
To use the Excel Report Instrument in LabWindows/CVI, you will need to first load the instrument. Go to Instrument >> Load and navigate to the ExcelReport.fp instrument under toolslib/activex/excel.
Here is some example code I whipped up to fill an array with random numbers and plot it as a 3d surface in Excel.
for (row = 0; row < ROWS; row++){
for (col = 0; col < COLS; col++){
multi[row][col] = Random (0, 100);
}
}
ExcelRpt_ApplicationNew (VTRUE, &RptApp);
ExcelRpt_WorkbookNew (RptApp, &RptWkbk);
ExcelRpt_WorksheetNew (RptWkbk, -1, &RptWksht);
ExcelRpt_WriteData (RptWksht, "A1: D5", ExRConst_dataDouble, ROWS, COLS, multi);
ExcelRpt_ChartAddtoWorksheet (RptWksht, 72, 144, 360, 360, &RptCht);
ExcelRpt_ChartWizard (RptCht, RptWksht, "A1: D5", ExRConst_Gallery3DSurface, 0, ExRConst_Rows, 0, 0, 0,
"My 3d Chart", NULL, NULL, NULL);
And here are the includes and variable declarations:
#include "excelreport.h"
#include "toolbox.h"
#include <cvirte.h>
#include <userint.h>
#include "MyExcelReportTest.h"
#define ROWS 5
#define COLS 4
static CAObjHandle RptCht;
static CAObjHandle RptWksht;
static CAObjHandle RptWkbk;
static CAObjHandle RptApp;
static int panelHandle;
double multi[ROWS][COLS];
int row, col;
This should give you a start for 3d plotting. I hope this helps.
Regards,
Marty H.
National Instruments