RList to Screen (OpenInsight 32-bit Specific)
At 29 JUN 2004 09:50:10PM Marty Rosenbloom wrote:
Hi,
I have created an RList statement that will run in the system editor but I can't get it to display to the screen using a button and the "click" event. What is the correct syntax so that I can do this?
RUN RLIST 'LIST SALES DEPARTMENT CLASS TOTAL FINAL_SALE TOTAL LINE_COMMISSION WITH WEEK_ENDING EQ "07/03/04" ',1
This works in the sytem editor.
TIA,
Marty
At 29 JUN 2004 11:22PM Richard Bright wrote:
You could call a script containing subroutine
/* Code Snipit - See Help for more info OIv7.01 */
Report_Name='
List_Statement=MyRlistStatement
Run_report(Rpt_Name,ListStatement)
Otherwise you could do something with oiview32
Richard Bright
BrightIdeas New Zealand
At 30 JUN 2004 01:21PM Richard Hunt wrote:
Marty,
You might want to check out the RECEIVER property and the SEND_DYN method.
The SEND_DYN method is just a simple call statement. SEND_DYN(MESSAGE).
At 30 JUN 2004 06:36PM Marty Rosenbloom wrote:
Hi Richard,
Thanks for the response.
I like Run_Report but I would like to change the selection criteria dynamically. The key is "Reservation" and the selection critreria is "Week_Ending". I have created a popup for the week ending and I can select the the proper reservations but I cannot get them to display on the report for the selected time period. When the report displays now, all reservations appear.
Marty
At 01 JUL 2004 01:16AM Richard Bright wrote:
Marty,
You do your filter first and make the resultant an anctive cursor then call your Rlist Statement so as to use the active cursor.
I have a predefined report template (which is what you are doing, in effect). I have a select filter tool to generate the select and then call the report.
Works like a charm.
If you need two or three lines of code to be more specific, let me know.
Richard Bright
BrightIdeas New Zealand
At 01 JUL 2004 03:14PM Marty Rosenbloom wrote:
Richard,
I'm making the transition from OI2.61 to OI7.01 so some of this is new to me. Some sample code including the run_report call would be great. I am having trouble getting the filters that I have done to work.
For future reference, where can I find help on run_report and oiview32?
Thanks,
Marty
At 01 JUL 2004 08:10PM Richard Bright wrote:
Marty,
Below is a rather long winded layout of code - could probable cut down to a few lines but not the time to do….
Help on the Run_Report, well highlight in sytem editor and press F1. ORMAIN32 may be there also. OIv7.01 has good docs - have come a long way.
/* Section of code from a script called from a Button Click event. Information is gathered from a record (Find) specifying default information on report to do and other information gathered on the fly */
/* part of code gathering info from editable to determine select and sort */
Case Find=2 ; * Table driven
Select_Tab=Get_Property(Win:'.SELECT_TABLE','ARRAY')
Replace all occurances of 'OPTION' in Sel_TabIf Index(Select_Tab,'OPTION',1) thenSwap 'OPTION' with '= in Select_TabEnd
Note 'with' must be followed by 'and with'; embedded or must invoke paretheses …Select='Sel_Cnt=Count(Select_Tab,@vm) + (Select_Tab NE '')For N=1 to Sel_Cnt While Select_Tab
Select_Row=Select_Tab :' ':Select_Tab:' ':Select_Tab :' ':Select_Tab :' ':Select_Tab:' 'Select_Row=Find :' ':Select_Tab:' ':Select_Tab :' ':Select_Tab :' ':Select_Tab:' 'If Select_Tab then
Addin paraentesisJoin=Select_TabSwap 'WITH' with '( WITH' in JoinSelect := Trim(Join:' ':Select_Row):' ) 'End ElseSelect := Trim(Select_Tab:' ':Select_Row):' 'EndNext NSort_Tab=Get_Property(Win:'.SORT_TABLE','ARRAY')Sort='Sort_Cnt=Count(Sort_Tab,@vm) + (Sort_Tab NE '')For N=1 to Sort_Cnt While Sort_TabSort_Row=Sort_Tab:' ':Sort_TabSort := Trim(Sort_Row):' 'Next N
Print OptionsUserArg=Get_Property(Win:'.PRINT_OPTIONS':@RM:Win:'.REPORT_PATH':@RM:Win:'.REPORT_COPIES','VALUE':@RM:'TEXT':@RM:'TEXT')Convert @RM to @fm in UserArgType =Find ;* RetValRpt_Name=Find ;*RetValTable =Find ;*RetValOutput =Find ;*RetVal
Save off SelectListFind=Date():'.':Time()Find =SELECT ":Table:" ":Sort :" ":SelectBegin CaseCASE Type=RB' ;* RList Builder Cataloged ReportStat=Utility("CURSOR","H")GoSub Make_Save_Listif Get_Status(status_code) thenCall MSG(Win,"Cant make select list: ":status_code)Returnend ElseActivate_Save_Select(Database:'*':@STATION)EndRun_report(Rpt_Name,'')CASE Type=RD' ;* Report Designer Select(Code continues)
Make_Save_List:
If table thenStatus=Set_Status(0) ;* Clear statusTargetname=Database:'*':@STATIONRlist("SELECT ":Table:" ":Sort :" ":Select, TARGET_SAVELIST$, TargetName,'','')if Get_Status() then* Have problemCall Msg(Win,'Have problem with selection')Endend Else
Set error statusStatus=1EndReturn
At 03 JUL 2004 12:17PM Marty Rosenbloom wrote:
Hi Richard,
That is rather long but I was able to adapt and condense for my own needs. I knew that I had to use @STATION but was at a loss in this version. Got it to work nicely for me, though.
THANK YOU!
Marty