Alpha Video Training
Results 1 to 7 of 7

Thread: Bar Chart: Print Problems

  1. #1
    Member
    Real Name
    David Boomer
    Join Date
    Apr 2000
    Location
    Brampton Ontario, Canada
    Posts
    662

    Default Bar Chart: Print Problems

    I have created a form that displays a bar chart. I construct the bar chart by setting the width of a text field each time a fetch action is executed.

    PROBLEM: the form displays correctly but when I print or print preview the form, the bars do not print (they show up as if I was printing the form from design mode) & many extra (blank) pages are printed.
    What am I doing wrong??
    daveboomer@aol.com

    The following is an example of the fetch action script:
    (I have also included the script for the BarWidth function)...

    'As
    :FrmUrineTmp:Text69.object.width = BarWidth(.21,.51,:FrmUrineTmp:Field6.value)
    :FrmUrineTmp:Text69.text = STR(:FrmUrineTmp:Field6.value,6,3)
    :FrmUrineTmp:Text69.Refresh()


    'B
    :FrmUrineTmp:Text120.object.width = BarWidth(1.9,4.4,:FrmUrineTmp:Field8.value)
    :FrmUrineTmp:Text120.text = STR(:FrmUrineTmp:Field8.value,6,2)
    :FrmUrineTmp:Text120.Refresh()


    'Ca
    :FrmUrineTmp:Text121.object.width = BarWidth(100,250,:FrmUrineTmp:Field9.value)
    :FrmUrineTmp:Text121.text = STR(:FrmUrineTmp:Field9.value,6,1)
    :FrmUrineTmp:Text121.Refresh()


    '_________________________


    function BarWidth as N(LowVal As N, HighVal As N, Observed As N)

    Select
    Case ObservedLowVal .and. Observed1.35*HighVal then
    Barwidth = 6.7
    else
    BarWidth = 5 + ((Observed-HighVal)/(HighVal*1.35))*1.7
    end if
    end select
    end function

  2. #2
    Member
    Real Name
    David Boomer
    Join Date
    Apr 2000
    Location
    Brampton Ontario, Canada
    Posts
    662

    Default RE: Bar Chart: Print Problems

    Well... I didn't get much help on this one... but I think I've got it figured out.

    The on-fetch event does not appear to execute when a print is carried out. So.... the idea of triggering text-field objects attributes via this event will only work for viewing the graph as you fetch through the records.

    To make it work I created cal variables (text) and a global function that returns the number of characters in a variable length string. The return function is passed three parameters: min max & observed.

    You can then populate the Calc Variable with any bar-graph chr you like eg Repeat(CHR(178),FunctionVal)
    The end product is quite acceptable & allows Alpha to produce bar charts.

    Hope this helps someone out there.
    Db

  3. #3
    Don Reed
    Guest

    Default RE: Bar Chart: Print Problems

    I have a text object on a form titled policy. I have a field called class. When class = to "layaway" then the text object changes to the policy statement for layaway. If class = "consign" then the policy statement changes to the policy statement for consignment. All works great until I print the form and the text object is blank. I tried saving the record before printing and still does not show the present policy statement.

  4. #4
    Member
    Real Name
    Jack Wheeler
    Join Date
    Apr 2000
    Posts
    570

    Default RE: Bar Chart: Print Problems

    Don Change your text object to either a button (diable it) or a variable as previously mentioned. Alpha does not calculate text objects while printing as it does as you view it. Jack

  5. #5
    Member
    Real Name
    Jack Wheeler
    Join Date
    Apr 2000
    Posts
    570

    Default RE: Bar Chart: Print Problems

    Hi David, did you read Mr Waynes article called line and bar graphs? I too found using objects works very well and is very easy to manipulate the data as you wish it to appear, however, it is very slow, Mr waynes article shows how to use API calls and the graphs are very fast! Try them. Jack

  6. #6
    Don Reed
    Guest

    Default RE: Bar Chart: Print Problems

    I tried replacing a button to do it and still no print results. How do I do this feat?


    Thanks Mr. Wheeler

  7. #7
    Member
    Real Name
    David Boomer
    Join Date
    Apr 2000
    Location
    Brampton Ontario, Canada
    Posts
    662

    Default RE: Bar Chart: Print Problems

    Thanks Jack...

    I took you advice & the results were pretty good.. but a trifle slow...So,,,

    I use this approach for small data sets & in cases where complex charts are not required.

    When complex charts are required (eg Pareto, Cusum, Shewart etc) I purchased a copy of the OCX version of ChartFX (available from SoftwareFX.com.

    I used Visual Basic to create a program that imports a text file generated by Alpha. The VB program performs some calcualtions/transformations on the data & stuffs it into the ChartFX OCX.

    Works like a charm! & can produce just about any chart you could imagine while allowing tremendous end-user flexibility.

    There is a bit of a learning curve for the developer but examples are provided & can usually be used out of the box as templates. The end-user is presented with an intuitively obvious interface to the charts.
    thanks
    David Boomer

Similar Threads

  1. Chart ActiveX without MS Office
    By Howard G. Cornett in forum Alpha Five Version 6
    Replies: 13
    Last Post: 12-16-2004, 06:27 AM
  2. Mileage chart
    By Al Lenkner in forum Alpha Five Version 6
    Replies: 5
    Last Post: 09-20-2004, 07:23 PM
  3. Chart program
    By Raymond Lyons in forum Alpha Five Version 5
    Replies: 14
    Last Post: 10-22-2003, 08:42 AM
  4. Eye chart
    By James Amundson in forum Alpha Five Version 5
    Replies: 25
    Last Post: 01-24-2003, 01:20 AM
  5. More Print Problems
    By Robert Cawley in forum Alpha Four Versions 7 and 8
    Replies: 7
    Last Post: 12-05-2001, 06:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •