{{tag>category:"OpenInsight 32-bit" author:"cmeyer" author:"Mike Ruane" author:"Andrew McAuley"}}
[[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]]
==== Chart no longer working in MS v10 (OWC11.EXE) (OpenInsight 32-bit) ====
=== At 15 JAN 2020 05:29:41PM cmeyer wrote: ===
Until recently I have been using RFC routine to display charts but OWC11.EXE is no longer compatible with Microsoft V10. The routine used as below:
Is there an OI compatible replacement for displaying charts
TIA
Chris
Compile Subroutine Chart_Display(Control,Xparms,Yparms,Header,Legend,Type, Stacked, File)
/*
Uses Microsoft Office Web Components
see http://www.microsoft.com/downloads/details.aspx?
familyid=7287252C-402E-4F72-97A5-E0FD290D4B76&displaylang=en
Usage: Create a window, add a bitmap, add a button which calls this function
12-07-2006 rjc Based on http://www.asp101.com/articles/chris/aspcharts/default.asp
Must install owc11.exe before this routine will work. This is found in c:\temp\microsoft\office OI chart interface directory
*/
Declare function GetTempPath, GetTempFilename, Unassigned
If Unassigned(Type) then Type = 'COLUMN'
$insert Logical
equ tab$ to \09\
equ eos$ to \00\
ChartSpace = OleCreateInstance("OWC11.ChartSpace")
x = ChartSpace->Clear()
c = ChartSpace->Constants
* Add a chart
Charts = ChartSpace->Charts
Chart = Charts->Add()
Begin Case
Case Type = 'LINE'
If Stacked then
Chart->Type = c->chChartTypeLineStacked
end else
Chart->Type = c->chChartTypeLine
end
Case Type = 'COLUMN'
If Stacked then
Chart->Type = c->chChartTypeColumnStacked
end else
Chart->Type = c->chChartTypeColumClustered
end
Case Type = 'PIE'
If Stacked then
Chart->Type = c->chChartTypePieStacked
end else
Chart->Type = c->chChartTypePie
end
Case Type = 'BAR'
If Stacked then
Chart->Type = c->chChartTypeBarStacked
end else
Chart->Type = c->chChartTypeBarClustered
end
Chart->Type = c->chChartTypeBarClustered
Case Type = 'AREA'
If Stacked then
Chart->Type = c->chChartTypeAreaStacked
end else
Chart->Type = c->chChartTypeArea
end
Case 1
Chart->Type = c->chChartTypeColumClustered
End Case
Chart->HasLegend = True$
Chart->HasTitle = True$
Title = Chart->Title
Title->Caption = Header
* Add Series
SeriesCollection = Chart->SeriesCollection
Lcount = Count(Legend,@vm) + (Legend # '')
for i = 1 to Lcount
Series = SeriesCollection->Add()
Series->Caption = Legend<1,i>
Categories=""
Vals=""
Xcount = Count(Xparms,@vm) + (Xparms # '')
For j = 1 To Xcount
Categories = Xparms<1,j>
Vals = Iconv(Yparms,'MD0')
Next
convert @fm to tab$ in categories
convert @fm to tab$ in vals
x = Series->SetData(c->chDimCategories, c->chDataLiteral, Categories)
x = Series->SetData( c->chDimValues, c->chDataLiteral, Vals)
next
* Export the chart to the temporary file
buffer = space(255)
ret = GetTempPath(len(buffer),buffer)
path = buffer[1,eos$]
ret = GetTempFilename(path, 'img', 0, buffer)
file = buffer[1,eos$]
x = ChartSpace->ExportPicture(file, "JPG", 640, 480)
osread image from file else image = ''
* Assume current window has a generic bitmap control
call Set_property(Control, 'IMAGE', image)
*osdelete file
return ''
----
=== At 16 JAN 2020 08:23AM Mike Ruane wrote: ===
I'm encouraged that the code has worked for 14 years.
We ( at Revelation ) take a lot of pains to try and be as backward compatible as possible.
Which is one reason we have clients that are still running basic code that was written in 1983 on a Pick box, and imported to Rev....
Anyway, have you looked at the O4W graphing capabilities?
Mike
----
=== At 16 JAN 2020 09:04AM Andrew McAuley wrote: ===
[url=https://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-msoffice_custom/microsoft-office-2010-web-components/f9671364-6e80-e011-9b4b-68b599b31bf5]Don't know if this will help?[/url]
[url=https://www.sprezzatura.com]The Sprezzatura Group[/url]
[url=https://www.sprezzatura.com/blog]The Sprezzatura Blog[/url]
[i]World leaders in all things RevSoft[/i]
[img]https://www.sprezzatura.com/zz.gif[/img]
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=C73676C1A805E74D9FA00B27A98F22FB|View this thread on the Works forum...]]