We have a client still running on OI 9.4 who wants to restrict the export options seen in this dialog:
The docs suggest that the PrintSetup<8> argument uses an @VM delimited list of values to enable/disable these options. However, this does not appear to work. Can this be confirmed or is there a solution I'm unaware of?
Hi, Don. Yes, it appears that at some point in the past this functionality was inadvertently lost, I'm afraid. I've recovered this functionality for the next release of OpenInsight 10.
The problem is that the information about which fields you want to disable (passed in during the INIT command) is wiped out during the TERM command processing. However, I believe I can give you a workaround for your OI 9.x. Where you currently call the TERM command:
x = Set_Printer("TERM", 1)Add the following code to save, and then restore, the passed-in details from your INIT statement:
save_init = Get_Property("VSPRINTER.INIT","TEXT" ) x = Set_Printer("TERM", 1) Call Set_Property("VSPRINTER.INIT", "TEXT", save_init)Hope that helps,
- Bryan Shumsky
Brian,
I think Don was wanting this to be fixed in 9.4
Hi Bryan,
Thank you for the response. I'll experiment with the workaround as soon as possible.
I have a related question based on client clarification. What he really wants is to ability to enable the CSV export option in cases where it isn't enabled by default. It appears that some reports enable this and some reports disable this automatically, but the reason for either is unclear. My best guess is that something inside the OIPI logic is looking at the content of the report and making this decision (perhaps the use of ADDTABLEs is a defining factor). Can you confirm what is going on?
I'm worried that even if I force the CSV button to be enabled, there actually won't be a CSV file generated. I'm basing this on the fact that the OIPI pre-generates export files as the report is being produced. In cases where the CSV button isn't enabled there is no pre-generated file. I would like to believe that forcing the CSV button to be enabled would also force the creation of a CSV file but I'm skeptical.
Hi, Don.
Yes, your conclusion is correct - the csv is actually built during report generation from ADDTABLE calls. If the output isn't generated with/by ADDTABLE, then the CSV (and the CSV option) isn't available.
I don't believe _forcing_ the CSV button to be enabled would actually get you CSV output; if it's not made during report building, I don't think asking for it afterwards will actually build a file.
- Bryan Shumsky
Bryan,
Your workaround works…but only partially.
Realizing that the OIPI won't generate a CSV export unless it sees ADDTABLE messages, we thought about generating our own CSV file while the report code is executing. We would save this file in the Windows temp folder just as the OIPI does. That way when the user clicks on the Export button and selects CSV, it will pull in the CSV file that we provided.
The only problem is that something keeps overriding the CSV button enabled status. I actually see the CSV button enabled when the Export Reports form is displayed but then it immediately gets disabled. So the CREATE event handler of VSPRINTER_PDF_DIALOG is still checking for something and then disabling the CSV button. I'm not sure what it is checking, but it doesn't seem to be the existence of a CSV file.
Hi, Don. Sorry for the confusion, but you've got your cart and horse reversed - OIPI doesn't look for the CSV file to know whether it should enable the option for CSV download; rather, ADDTABLE (while building the CSV file) sets a flag internally, and that FLAG is what tells OIPI that the CSV is an available download type.
For a TRUE "hack", if you really wanted to force it, after you've called the TERM command, and after you've created your own CSV file, you could set the flag SHELL% to "1". This is a common variable that's found in the OIPI_COMMON insert, which I believe is distributed?
- Bryan Shumsky
Bryan,
No apologies needed. I don't think there was confusion. I've long understood that the cart was coming before the horse and we are just trying to figure out how to fake it.
The good news is that setting the SHELL% common variable works! I think we have a way forward. Again, many thanks for accompanying me on this journey and offering guidance.
I've been traveling so my response may not be useful.
Here is documentation that I have about Set_Printer "INIT" Param5<8> known as Hidden Export Formats:
When the Export Formats dialog is launched from the Preview window, it is possible to disable
specific formats: "1" to disable the option.
<8,1> PDF; <8,2> RTF; <8,3> Save Report; <8,4> Load Report
<8,5> CSV; <8,6> Archive; <8,7> N/A; <8,1> HTML