LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Display filenames on the scale of x-axis for a graph in excel sheet

Hi,

 

I have a doubt in generation of graphs in an excel sheet.

I have to generate a graph for parameter vs different filenames i.e, i should be able to display filenames on the x-axis scaling.

I have to get this using excel api's.

Is there any excel api to do this?

If yes, what is the api?

Can any one help me in doing this?

 

Safer
0 Kudos
Message 1 of 6
(4,139 Views)

There is a library using the Excel ActiveX interface. It is located in \<CVI>\toolslib\activex\excel\excelreport.fp

 

Just add the excelreport.fp and excelreport.c files to your project and you are ready to go. This library is not a complete API but it includes almost all necessary functions and it is much much easier to use than the full API, excel.fp

 

Just a reminder: do not forget to discard any application/workbook/worksheet handle with CA_DiscardObjHandle function when you do not need it anymore.

Otherwise, you will have ghost Excel processes remaining in your Task Manager application list, even if you exit the application.

 

Hope this helps, 

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 6
(4,122 Views)

Thank you Sir for your suggestion.

Now, i am using excelreport.fp file in my .prj

Here, in my project i am using various excel api's such as

ExcelRpt_ChartSetSourceRange

HRESULT ExcelRpt_ChartSetSourceRange (CAObjHandle chartHandle, CAObjHandle worksheetHandle, char sourceRange[]);

ExcelRpt_SetChartAttribute

HRESULT ExcelRpt_SetChartAttribute (CAObjHandle chartHandle, int attributeID, . . .);

ExcelRpt_SetChartAxisAttribute

HRESULT ExcelRpt_SetChartAxisAttribute (CAObjHandle chartHandle, enum ExREnum_ExAxisType axisType, enum ExREnum_ExAxisGroup axisGroup, int attributeID, . . .);

But, i am unable to set the filenames as scaling on x-asis.

Can you please suggest me how can i display/set the filenames as scale on x-axis.

Thankyou in advance.

 

 

 

 

 

Safer
0 Kudos
Message 3 of 6
(4,078 Views)

It's very tricky to get it to work as you want when controlling Excel.

Took me some time to generate a correct graph by modifying the original example

shipped with LabWindows/CVI. 

 

Please take a look at the attached CVI project and you will find out some clues

for your application.  Run the project and click "Copy Table" then "Calculate"

then "Graph".   Notice the comments that I made in the code of

"excelreportdemo.c".  You need to use the right functions to generate the right

graph.  I use CVI 6.0 and the code works fine with Excel 2003.

 

 

0 Kudos
Message 4 of 6
(3,943 Views)

Thankyou Sir.

But I am unable to build this as ExcelReportDemo.h file is not included in the zip file which you have uploaded.

If possible can you upload the above specified file so that this will be helpful for me.

Thankyou again Sir.

 

Safer
0 Kudos
Message 5 of 6
(3,859 Views)

OK.  Here is the revised zip file containing "ExcelReportDemo.h".

 

0 Kudos
Message 6 of 6
(3,843 Views)