Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2007

Tip: Looking for answers? Try searching our database.

Creating a chart in Excel using VC++ .net 2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
antarikshv - 16 Oct 2007 12:37 GMT
Hi,
Can any one please help me in creating chart in VC++ .net 2005 and
Excel 2003.
I am stuck at the point when i want to give a specific column as the X-
axis and a specific column as Y-axis. currently i am able to specify a
range and draw the chart. If you could give the code then it will be
the best thing. the following is the code i am referring to.

// The following code draws the chart
Excel::ChartObjects^ chartobjects =
safe_cast<Excel::ChartObjects^>(worksheet->ChartObjects(oMissing));

            Excel::ChartObject^ chartobject =
safe_cast<Excel::ChartObject^>(chartobjects->Add(10 /*Left*/, 100 /
*Top*/, 450 /*Width*/, 250 /*Height*/));
            Excel::_Chart^ chart = safe_cast<Excel::_Chart^>(chartobject-
>Chart);

            // Call to chart.ChartWizard() is shown using late binding
technique solely for the demonstration purposes
            array<Object^>^ args7 = gcnew array<Object^>(11);
            args7[0] = ran; // Source
            args7[1] = Excel::XlChartType::xlLineMarkers; // Gallery - note,
we're using implicit boxing here
            args7[2] = oMissing; // Format
            args7[3] = Excel::XlRowCol::xlRows; // PlotBy - note, we're using
implicit boxing here
            args7[4] = nullptr; // CategoryLabels
            args7[5] = nullptr; // SeriesLabels
            args7[6] = true; // HasLegend - note, we're using implicit boxing
here
            args7[7] = "Sample Chart"; // Title
            args7[8] = "Sample Category Type"; // CategoryTitle
            args7[9] = "Sample Value Type"; // ValueTitle
            args7[10] = oMissing; // ExtraTitle
            // The last parameter is lcid, but as we use late binding here it
should be omited
            //args7[11] = 0; // lcid
            chart->GetType()->InvokeMember("ChartWizard",
System::Reflection::BindingFlags::InvokeMethod, nullptr, chart,
args7);

Also i am unaware of late bindings. Can anyone help with what it means
and what effect does it have on performance.
Alvin Bruney [MVP] - 17 Oct 2007 01:18 GMT
you can find code to build a chart in C# at the
office.developer.web.components newsgroup. You'll then need to do some
translation

Signature

Regards,
Alvin Bruney
------------------------------------------------------
Shameless Author Plug
OWC Black Book 2nd Edition
Exclusively on www.lulu.com/owc
$24.99

> Hi,
> Can any one please help me in creating chart in VC++ .net 2005 and
[quoted text clipped - 40 lines]
> Also i am unaware of late bindings. Can anyone help with what it means
> and what effect does it have on performance.
antarikshv - 17 Oct 2007 05:02 GMT
On Oct 17, 5:18 am, "Alvin Bruney [MVP]" <some guy without an email
address> wrote:
> you can find code to build a chart in C# at the
> office.developer.web.components newsgroup. You'll then need to do some
[quoted text clipped - 4 lines]
> Alvin Bruney
> ------------------------------------------------------
Hi, Can please give me some link for it? currently i am not able to
find the reference. Please help

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.