{{tag>category:"OpenInsight 32-bit" author:"Jonathan Bird" author:"bshumsky"}} [[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]] ==== More on the Banded report writer (OpenInsight 32-bit) ==== === At 09 JAN 2012 04:57:56PM Jonathan Bird wrote: === On the whole, the BRW is good, well done guys! As well as a few other thing I've reported, here is anoter one:- With this code: FileName = "Whatever" PrintTitle = "Printing..." PreviewTitle = "Print preview" margins = 5:@fm:5:@fm:5:@fm:5:@fm:@fm:@fm:9 Orientation = '1' ;*Landscape Orientation<2> = '2' ;*Units are mm PrintSetup = '3' status = Set_Printer("INIT", FileName, PrintTitle : @fm : PreviewTitle, Margins, Orientation, PrintSetup) If status < 1 Then ErrorMsg = "Fatal error with the INIT message, Status is " : status Return End RList(SelectStmt,5,'','','') Set_Printer('LOADREPORT','REPORT_3V1','REPORT_3V1',0) Set_Printer('TERM') The BRW output is sent to the OIPI interface, which is good. HOWEVER, even though the BRW reprt definition is set to landscape, and the code above requests landscape, the output is done in portrait. ALSO any subsequent running of the code results in an empty report result. Cheers. ---- === At 09 JAN 2012 06:26PM bshumsky wrote: === On the whole, the BRW is good, well done guys! As well as a few other thing I've reported, here is anoter one:- With this code: FileName = "Whatever" PrintTitle = "Printing..." PreviewTitle = "Print preview" margins = 5:@fm:5:@fm:5:@fm:5:@fm:@fm:@fm:9 Orientation = '1' ;*Landscape Orientation<2> = '2' ;*Units are mm PrintSetup = '3' status = Set_Printer("INIT", FileName, PrintTitle : @fm : PreviewTitle, Margins, Orientation, PrintSetup) If status < 1 Then ErrorMsg = "Fatal error with the INIT message, Status is " : status Return End RList(SelectStmt,5,'','','') Set_Printer('LOADREPORT','REPORT_3V1','REPORT_3V1',0) Set_Printer('TERM') The BRW output is sent to the OIPI interface, which is good. HOWEVER, even though the BRW reprt definition is set to landscape, and the code above requests landscape, the output is done in portrait. ALSO any subsequent running of the code results in an empty report result. Cheers. Hi, Jonathon. One quick thing I noticed in your example - the call to LOADREPORT you're using has the parameters wrong. It should be: SET_PRINTER("LOADREPORT", reportGroup, specificReportName, overrideListName, doAppend) As it stands in your example, you're passing in an overrideListName of "0", which I am assuming is _not_ what you had intended... Also, while I can see this is something we might want to enhance in the future, for now the LOADREPORT does [i]not[/i] support the passing in of an active list instead of the overrideListName; if you wanted to pass in a list there, you should save the list yourself using a temporary name, and then pass in that saved list name directly. - Bryan Shumsky [url=http://www.revelation.com]Revelation Software, Inc.[/url] ---- === At 09 JAN 2012 11:46PM Jonathan Bird wrote: === Hi Bryan, The code (unmodified as suggested by you) DOES work - the correct select is passed into the set_printer as an active list. Maybe this is a bug (!!??). However, I did modify the code to use a saved list, and that works correctly too. The main point of my post, however, was that portrait orientation is produced, even tough the BRW definition, and the set_printer INIT call ask for landscape orientation, AND that on a second running of it, NOTHING is displayed in the printer output (not even column headings) ---- === At 10 JAN 2012 12:28AM bshumsky wrote: === Hi Bryan, The code (unmodified as suggested by you) DOES work - the correct select is passed into the set_printer as an active list. Maybe this is a bug (!!??). However, I did modify the code to use a saved list, and that works correctly too. The main point of my post, however, was that portrait orientation is produced, even tough the BRW definition, and the set_printer INIT call ask for landscape orientation, AND that on a second running of it, NOTHING is displayed in the printer output (not even column headings) Hi, Jonathon. Yes, I didn't forget about your main issues; while I was investigating them, though, I did want to point out that the call you were making to SET_PRINTER did not have the proper parameters (even if it appeared to work for you). What I've discovered regarding the orientation problem is that, when the append flag (the final parameter of the LOADREPORT call) is set to 0, the current document is reset to its defaults, and that includes the orientation (which defaults to portrait). Your desired orientation (landscape) is thus lost. As a work-around, you can set the append flag to 1 instead of 0, and hopefully that will make the output keep the landscape orientation. The orientation always being set to portrait will be fixed for the 9.3.1 release, scheduled for mid-February Regarding the problem with the second and subsequent runs not generating any output - I haven't been able to recreate that problem, so it's possible that it's already been resolved in the BRW or its support routines, but I will continue to see if there are any indications as to what might be going on. One possibility, though perhaps it is unlikely, is that the passing of the calling parameters in an incorrect order, or unsupported options, could cause unexpected behavior; that's why I'd suggested that you change your call to use the parameters I indicated, and remove the unsupported call to activate the select list, to see if that changes anything. In the previous BRW thread, I also suggested that you try using the bUseGUI flag set to 1, instead of 2, during the calls to RTI_BRW_GENERATEREPORT to see if that changes the behavior in any way; please let me know what you find after making that change, too? Finally, I know that sometimes the message boxes or other UI elements from the BRW get hidden behind the active OpenInsight windows; it makes the BRW appear unresponsive, or halts any output from appearing, even though it's just waiting for a mouse click. You may want to minimize all the windows on your desktop, and walk through them one at a time, to see if there's a "hiding" BRW dialog on your subsequent calls that's making it seem like no output is generating. Hope that helps, - Bryan Shumsky [url=http://www.revelation.com]Revelation Software, Inc.[/url] ---- === At 10 JAN 2012 05:54PM Jonathan Bird wrote: === Hi Bryan, OK, here's what I've done and the results 1. Using RTI_BRW_GENERATEREPORT I changed the bUseGUI flag to 1. I get the print dialog. No preview. (as expected) So in summary, 0 and 2 give the same behaviour - ie output sent directly to the default printer. 1 gives me a printer dialog. On any second or subsequent use of RTI_BRW_GENERATEREPORT I get nothing. If I then attempt to open the BRW designer I get a message "Unable to connect to OpenInsight...terminating" 2. Using a call to set_printer LOADREPORT I changed the append flag to 1 and the report outputs as landscape. On any second or subsequent use of LOADPRINTER I get nothing. There are no other windows lurking in the background. If I then attempt to open the BRW designer I get a message "Unable to connect to OpenInsight...terminating" Hey, these are big niggles, but I think what you guys have done with the BRW is seriously good. Well done! J ---- === At 10 JAN 2012 11:03PM bshumsky wrote: === Hi Bryan, OK, here's what I've done and the results 1. Using RTI_BRW_GENERATEREPORT I changed the bUseGUI flag to 1. I get the print dialog. No preview. (as expected) So in summary, 0 and 2 give the same behaviour - ie output sent directly to the default printer. 1 gives me a printer dialog. On any second or subsequent use of RTI_BRW_GENERATEREPORT I get nothing. If I then attempt to open the BRW designer I get a message "Unable to connect to OpenInsight...terminating" 2. Using a call to set_printer LOADREPORT I changed the append flag to 1 and the report outputs as landscape. On any second or subsequent use of LOADPRINTER I get nothing. There are no other windows lurking in the background. If I then attempt to open the BRW designer I get a message "Unable to connect to OpenInsight...terminating" Hey, these are big niggles, but I think what you guys have done with the BRW is seriously good. Well done! J Hi, Jonathon. Glad you're liking it (overall). Also glad to hear that the "append" parameter has helped with the landscape printing on the LOADREPORT. I believe the problems with the LOADREPORT and landscape printing, and the RTI_BRW_GENERATEREPORT and the bUseGUI flag set to 2, have been found and fixed. However, I still don't have any idea why you're not seeing subsequent reports after the first one completes. Did you create or modify a configuration record (CFG_OIBRW) as discussed in one of the other threads, or are you using the default behavior? The default behavior should have the BRW using its own OEngine to communicate with OI, while the configuration record would allow you to have the BRW "share" the currently running OEngine. I'm just wondering which environment you're testing under, to see if that might be contributing to the problem you're seeing... - Bryan Shumsky [url=http://www.revelation.com]Revelation Software, Inc.[/url] ---- === At 11 JAN 2012 01:12PM Jonathan Bird wrote: === Hi Bryan, I have no CFG_OIBRW record in SYSENV. Should I see another Engine in the task bar when running the reports? Because I don't. J ---- === At 11 JAN 2012 01:16PM bshumsky wrote: === Hi Bryan, I have no CFG_OIBRW record in SYSENV. Should I see another Engine in the task bar when running the reports? Because I don't. J Hi, Jonathon. No, when the BRW connects using a separate OEngine, that's not shown on the task bar normally. Hmm, so what would it mean that you can't launch it a second time?? Even if for some reason the previous invocation didn't clean up completely and was "stuck" in memory, I wouldn't expect to see the message you're seeing. I am assuming you're using a copy of OpenInsight that has more than a two user license, right...? - Bryan Shumsky [url=http://www.revelation.com]Revelation Software, Inc.[/url] ---- === At 11 JAN 2012 04:34PM Jonathan Bird wrote: === MORE than 2 users? No, I am using a 2 user license. I need more than 2? I have a 10 user engine in our production system, but I've not upgraded that. I'll get a copy and upgrade it and see what happens. ---- === At 11 JAN 2012 04:51PM bshumsky wrote: === MORE than 2 users? No, I am using a 2 user license. I need more than 2? I have a 10 user engine in our production system, but I've not upgraded that. I'll get a copy and upgrade it and see what happens. Ah ha! The plot thickens! :smile: Yes, you'd think a 2 user license should be enough, but as I mentioned if for some reason the BRW report isn't "wrapping up" properly, and is thus keeping one of your licenses in use, AND you're using OpenInsight on the desktop (as you must be), then maybe what we've been seeing is an "out of licenses" situation, rather than a "BRW is broken" situation. Still something we'll need to figure out so it's working properly, but it's a different focus as to where the problem may lie... - Bryan Shumsky [url=http://www.revelation.com]Revelation Software, Inc.[/url] ---- === At 11 JAN 2012 06:35PM Jonathan Bird wrote: === Indeed, soup thickens, plots deepen. :wink: Anyway, using a ten user license works OK, in that I can go back and run the report again ad get results, and also go in to the BRW designer after running the report and it works too. I still have the problem of not being able to preview the report when using RTI_BRW_GENERATEREPORT. But I can use LOADREPORT in set_printer as a work around. Thanks. J [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=550E199F000445C9445682000|View this thread on the Works forum...]]