AnsweredAssumed Answered

Graph to show amount of invoices created in a year

Question asked by willrollo on Feb 13, 2013
Latest reply on Nov 15, 2015 by williamrollo

Title

Graph to show amount of invoices created in a year

Post

     Hi
     i have seen a similar post to this already on the forum but am still a little stuck.

     I want to be able to select a year from my drop down that will then go to my graph layout. On the graph, I want to have the year on the x axis, with jan to dec increments (column graph) and the quantity of invoices for that month on the y axis. I have attached below the script so far, but it doesnt work  - I have created dummy data for 2012 but this shows no graoh at all on the layout, for 2013 it does show the correct amount of invoices, (2 in feb 2012) but for the wrong month!

     I would love some advice! Of course I can supply further detail....

      

         
  •           Set Error Capture [ On ]
  •      
  •           Allow User Abort [ Off ]
  •      
  •           Freeze Window
  •      
  •           Commit Records/Requests [ Skip data entry validation; No dialog ]
  •      
  •           #Validate Dates
  •      
  •           If [ IsEmpty (PREF::gYear ) ]
  •      
  •           #Missing year
  •      
  •           Show Custom Dialog [ Title: "Warning"; Message: "Please select a year."; Default Button: “OK”, Commit: “Yes” ]
  •      
  •           Exit Script [ ]
  •      
  •           End If
  •      
  •           Close Window [ Name: "Sales by Item Detail"; Current file ]
  •      
  •           New Window [ Name: "Sales by Item Detail"; Height: 900; Width: 750; Top: 10; Left: 10; Style: Document; Close: “Yes”; Minimize: “Yes”; Maximize: “Yes”; Zoom Control Area: “Yes”; Resize: “Yes” ]
  •      
  •           Go to Layout [ “Graph Sales by Month” (Invoices) ]
  •      
  •           #Find by specified date range.
  •      
  •           Enter Find Mode [ ]
  •      
  •           Set Field [ Invoices::graph_year; PREF::gYear ]
  •      
  •           Perform Find [ ]
  •      
  •           If [ Get (FoundCount) = 0 ]
  •      
  •           #No records found
  •      
  •           Close Window [ Current Window ]
  •      
  •           Refresh Window
  •      
  •           Show Custom Dialog [ Title: "Message"; Message: "No orders found within the specified date range."; Default Button: “OK”, Commit: “No” ]
  •      
  •           Exit Script [ ]
  •      
  •           End If
  •      
  •           Show/Hide Toolbars [ Show ]
  •      
  •           Print Setup [ Orientation: Portrait; Paper size: 8.26" x 11.69" ] [ Restore; No dialog ]
  •      
  •           Sort Records [ Keep records in sorted order; Specified Sort Order: Invoices::graph_month; ascending ] [ Restore; No dialog ]
  •      
  •           View As [ View as List ]
  •      
  •           Go to Record/Request/Page [ First ]
  •      
  •           Refresh Window
  •      
  •           Enter Preview Mode
  •      
  •           Go to Record/Request/Page [ Last ]
  •      
  •           Set Field [ PREF::gPageNumber; Get (PageNumber) ]
  •      
  •           Go to Record/Request/Page [ First ]
  •      
  •           Pause/Resume Script [ Indefinitely ]
  •      
  •           Enter Browse Mode
  •      
  •           Close Window [ Current Window ]

2013-02-13_02.45.05_pm.png

Outcomes