[Closed]Variable name for report format when scheduling a report
When I run a report the form has a variable called &OUTFMT. When selecting my report criteria, I select "PDF" as the value for &OUTFMT. If I then try to schedule this report the schedule pop-up defaults the report format to HTML. If I forget to change this, then the report is run in HTML even though the code in the report is as below, with "PDF" still being the value for &OUTFMT.
ON TABLE PCHOLD FORMAT &OUTFMT
What is the variable name that is causing the report to ignore the line above in the code and display the report in html?This message has been edited. Last edited by: Laura1,
WebFOCUS 8105m as well as 7.6.11 Windows 10
November 02, 2011, 05:06 PM
njsden
Somewhere in your report procedure (.fex) you should have a line that says:
-DEFAULT &OUTFMT = 'HTML';
When you're creating a schedule, Report Caster parses your .fex and creates a list of parameters and default values based on the &variables in finds.
So, if you want 'PDF' to be the default value for &OUTFMT just make it so in the .fex itself.
The reason i need the variable name is that i want to code around the report being run in HTML. Currently I've got code that says if &OUTFMT eq 'PDF' then I use a fold-line, however if the scheduler runs the report in HTML while the variable for output is still 'PDF' an error occurs. I want to say -IF (&OUTFMT NE 'PDF') OR (&UNKNOWN NE 'PDF') GOTO :SKIPFOLD; BY ACCOUNT FOLD-LINE -GOTO :FIN_ACCT; -:SKIPFOLD BY ACCOUNT -:FIN_ACCT ...This message has been edited. Last edited by: Laura1,
WebFOCUS 8105m as well as 7.6.11 Windows 10
November 03, 2011, 11:12 AM
njsden
Laura1, you still have your &OUTFMT variable to make your code do whatever it needs depending on its value. I haven't suggested anything contraty to that.
-DEFAULT is just that, a "default" value assigned to an amper variable in case there is nothing passed to it in runtime (from a form, URL, Report Caster, etc.).
Your original question was about how to make ReportCaster pick up "PDF" instead of "HTML" when creating the parameters? -DEFAULT is the way to do it. It won't affect anything of what you currently have.
If you have a form that is passing &OUTFMT=HTML to your report, then HTML will override the default "PDF" value you have in your code. If you pass &OURFMT=PDF this "PDF" value will override the default "PDF" in your code (yeah, it looks silly to override something with the same value but that's the effect of *setting* a variable vs. a default value).
Just to test, add the -DEFAULT statement I provided you with and test that when running your report from the HTML form you can pick any output format and get the results expected. Once you're convinced that this is okay, then try to create a new schedule in ReportCaster and see what effect it has when populating the initial list of parameters.
The problem is the scheduler doesn't actually overwrite the value of &outfmt it just ignores it and uses some unseen variable to determine the report output based on selection made on the schedule form.
WebFOCUS 8105m as well as 7.6.11 Windows 10
November 03, 2011, 01:04 PM
Doug
Does this happen in the Auto Prompting facility as well?
In FOCUS Since 1983 ~ from FOCUS to WebFOCUS. Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
November 03, 2011, 03:01 PM
Laura1
I'm not sure what you mean by Auto Prompting.
WebFOCUS 8105m as well as 7.6.11 Windows 10
November 03, 2011, 06:44 PM
Sayed
I believe Doug is referring to running it outside reportcaster, without launch page screen (run just the .fex file and a autoprompt screen should appear). Try running the report from MRE or Dashboard. Does your parameter selection get overwritten by something else?
Thanks, Saye
WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
November 04, 2011, 04:30 PM
N.Selph
Report Caster has always ignored the variable for output type that you put in your code. DEFAULTS or anything dont help.
Whatever the output type that you use when you schedule it is what it will deliver. Laura1 is right, however it may not be a variable, it picks up the value in BOTTASK.SENDFORMAT to send the data regardless of what is in your fex.
In the bottask the index I believe is taskid and you would then be able to query the bottask table by using &DSTTASKID in the where clause. You would have to save the SENDFORMAT reteived in a HOLD file by using the following:
ON TABLE HOLD AS SF FORMAT ALPHA
Once the data is saved you will then be able to do a -READ and save the format to an amperVariable. Once you have the information, you can then test the &OUTFMT variable and change it accordingly.
Please update the case with your comments. Should we still proceed with the new feature request to expose SENDFORMAT or is this info enough to resolve your issue.
Thank you and have a great day, Barry Solomon Information Builders