Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Activex Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Activex Help

    I try to do things myself by looking at examples on this forum, and reading any documentation that I can, and I suspect this shouldn't be too hard, but..

    I am trying to get an Activex Charting control called ChartDirector to work in A5V9. I know the Activex control is installed and working because I can run the following vbscript and it generates the attached files just file.

    I drop the Activex control on my form, but the OLE Object browser doesn't look right to me, and I can't seem to change from the vbs syntax to A5's.

    I am willing to try suggestions, it's just having spent 3-4 hours last night on it, I'm ready for someone who knows what they're doing to help.

    Thanks in advance,
    Alan

    vbscript code is here:
    Code:
    Sub createChart(img)
    
        Set cd = CreateObject("ChartDirector.API")
    
        ' query string to determine the starting angle and direction
        angle = 0
        clockwise = True
        If img <> "0" Then
            angle = 90
            clockwise = False
        End If
    
        ' The data for the pie chart
        data = Array(25, 18, 15, 12, 8, 30, 35)
    
        ' The labels for the pie chart
        labels = Array("Labor", "Licenses", "Taxes", "Legal", "Insurance", _
            "Facilities", "Production")
    
        ' Create a PieChart object of size 280 x 240 pixels
        Set c = cd.PieChart(280, 240)
    
        ' Set the center of the pie at (140, 130) and the radius to 80 pixels
        Call c.setPieSize(140, 130, 80)
    
        ' Add a title to the pie to show the start angle and direction
        If clockwise Then
            Call c.addTitle("Start Angle = " & angle & _
                " degrees<*br*>Direction = Clockwise")
        Else
            Call c.addTitle("Start Angle = " & angle & _
                " degrees<*br*>Direction = AntiClockwise")
        End If
    
        ' Set the pie start angle and direction
        Call c.setStartAngle(angle, clockwise)
    
        ' Draw the pie in 3D
        Call c.set3D()
    
        ' Set the pie data and the pie labels
        Call c.setData(data, labels)
    
        ' Explode the 1st sector (index = 0)
        Call c.setExplode(0)
    
        ' output the chart
        Call c.makeChart("anglepie" & img & ".png")
    
    End Sub
    
    Call createChart(0)
    Call createChart(1)

    #2
    Re: Activex Help

    Have you tried the ActiveX tutorial that ships with Alpha5? There are samples for various charts already there (Go to New - then select Activex Tutorial from the Sample and Tutorial Databases)

    Comment


      #3
      Re: Activex Help

      Yes I have looked at those. They use SimpleChart for the Activex, and by looking at the tutorials for it, I can't get this one to work, since the syntax appears to be different, and SimpleCharts seems a little more integrated into A5.

      And the ones that use the MS Chart control are similar, but again syntax looks like it's different, and that's basically where I'm having my problems.

      Alan
      Last edited by asawyer13; 08-26-2008, 11:25 AM.

      Comment


        #4
        Re: Activex Help

        Hi Alan,
        I hope to learn a bit from this.....

        As far as I have learned, the controls of an ActiveX component you place on a form is controlled via what is found in two places after right clicking--choosing "Show Xbasic to Set ActiveX Properties" or choosing "Events-->ActiveXEvent". Nowhere have I heard of someone using a vb script to control ActiveX....but as I said, I hope to learn something new here. :)
        Mike
        __________________________________________
        It is only when we forget all our learning that we begin to know.
        It's not what you look at that matters, it's what you see.
        Henry David Thoreau
        __________________________________________



        Comment


          #5
          Re: Activex Help

          I believe the vbscript needs to be converted to xbasic, however I don't seem to be able to determine how to do that.

          Alan

          Comment


            #6
            Re: Activex Help

            When I right click, I seem to be missing tons of Properties/Methods..

            I don't really have much that looks correct. Maybe it's the ChartDirector DLL, though it works well with vbs and vb6. They also support ASP/php, etc, but that's a different story.

            Alan

            Comment


              #7
              Re: Activex Help

              Both the VB and VBS code uses Calls to do the work, so maybe that means that the properties/methods don't exist in the manner than we're used to.

              Not sure, but I sure would like to figure out how to get it working.

              Alan

              Comment


                #8
                Re: Activex Help

                I am making a little progress.

                I can almost get the program to create the chart on disk.

                Here is code I'm using.

                Code:
                dim Chart as p
                dim Graph as p
                dim Return1 as p
                dim Return2 as n
                dim Return3 as c
                dim data[1,5] as n
                dim label[1,5] as c
                
                data[1] = 500
                data[2] = 800
                data[3] = 200
                data[4] = 1500
                data[5] = 500
                
                label[1] = "Monday"
                label[2] = "Tuesday"
                label[3] = "Wednesday"
                label[4] = "Thursday"
                label[5] = "Friday"
                
                Chart = ole.Create("chartdirector.api")
                
                'Graph = activex2.activex.this
                Graph = Chart.piechart(280,240)
                
                Return2 = Graph.SetPieSize(140,130,80)
                Return1 = Graph.addTitle("Hello")
                Return2 = Graph.setStartAngle(0,1)
                Return2 = Graph.set3D()
                
                Return2 = Graph.setData(data,label)
                
                Return2 = Graph.setExplode(0)
                
                Return3 = Graph.makeChart("c:\anglepie.png")
                The file it produces is below.

                Looks like I'm having a problem passing the data and labels, and of course, I'm not really doing anything with the Activex control yet, but at least it's doing something

                Any ideas would be appreciated.

                Alan

                Comment


                  #9
                  Re: Activex Help

                  Hi Alan,

                  SimpleChart is not as sophisticated as the chart you are trying to use, I wish it was.

                  I have attached two examples of what I have done with SimpleChart. As you can see on the PDF, you can print out a hard copy.

                  Here is the code for the Pie Chart
                  'Date Created: 01-Sep-2007 06:54:44 PM
                  'Last Updated: 07-Oct-2007 03:42:25 PM
                  'Created By : Keith Hubert
                  'Updated By : Keith Hubert

                  'Pie Chart

                  dim segment_ID as N =1
                  dim maxValue as N=0
                  dim maxsegment_ID as N=0
                  dim bigData as p

                  dim chart as P
                  dim tbl as p

                  tbl=table.current()

                  chart=activex2.activex.this
                  chart.chartdata.clear()
                  tbl.fetch_first()
                  while .not. tbl.fetch_eof()

                  chart.chartdata.add(tbl.Team,tbl.Total_Scores,0)
                  if (tbl.Total_Scores>maxValue) then
                  maxValue=tbl.Total_Scores
                  maxsegment_ID=segment_ID
                  end if
                  segment_ID=segment_ID+1
                  tbl.fetch_next()
                  end while

                  bigData= Chart.ChartData(maxsegment_ID)
                  bigData.Exploded = .t.
                  Chart.BorderVisible = .F.
                  'chart.ChartData(3).Hidden = .T.
                  chart.showpercentages=.T.
                  Chart.PercentTextFont.Bold = .T.
                  Chart.PieLabelMode =0 'scPieLabelModeOutside
                  chart.caption="Total Score Distribution"

                  Chart.LegendTitle = "Teams"
                  chart.refresh()
                  I will be interested in seeing what results you get with your Charting software.

                  If you would like help with SimpleChart let me know.
                  Regards
                  Keith Hubert
                  Alpha Guild Member
                  London.
                  KHDB Management Systems
                  Skype = keith.hubert


                  For your day-to-day Needs, you Need an Alpha Database!

                  Comment


                    #10
                    Re: Activex Help

                    I found out that I don't need the Return variables, but still having issues in passing the array and being able to get the actual activex control to be referenced and work.

                    I have moved the passing the array to a separate question, so maybe someone who is familiar with declarestruct or whatever I need to do, might be able to help since it's not a question that's specific to ChartDirector.

                    I don't give up easily, so I will continue and let you know what I come up with.

                    Alan

                    Comment


                      #11
                      Re: Activex Help

                      Keith,
                      Thanks for the SimpleChart stuff also. If I get to where ChartDirector is a washout, I will look again at SimpleChart which does work.

                      Alan

                      Comment

                      Working...
                      X