Setting an item value before print report in BI Publisher

Hi,
I am having an issue with setting a page item's value once a button (that prints a BI Publisher report) is pressed. The session state for the item is set, however because the page does not re-load no value appears in the item on the page.
I am using a button as a page Item and using a Page Branch with the Branch Point set as On Submit: After Processing(After Computation, Validation, and Processing) with the Page set to 0 and the Request set to PRINT_REPORT=REPORT
Is there any way to set the item value on the page before branching to the report?
Your help is greatly appreciated.
-Marsha

Marsha,
You can do that as follows:
1- create a hidden text item (P20_date_hidden) with default value set to sysdate.
2- for your button >> edit >> Buttom display attributes >> attributes >> type in : onFocus= "set_date();" (( note: am using onFocus because it takes places before onClick ))
3- In your page >> edit >> HTML header >> type in :
<script language="JavaScript" type="text/javascript">
function set_date()
v_date = $x('P20_DATE_HIDDEN').value;
$x('P20_DATE_LETTER_SENT').value = v_date;
</script>
Hope this helps,
Sam
Please reward good answers by marking them correct or useful!

Similar Messages

  • How to set the default values for print options

    Hi all,
    We can set the default value for print options, just like Logical destination、numbers of messages、print immediately and so on, so where we should to maintain these default?

    Hi Sandy,
    This can be done by an abaper by making changes in the driver program. The Driver program feeds all the data which u have mentioned for printing.
    if the driver program is standard. copy to an z type and make modification on printer settings on the driver program code.
    this will surely solve the issue.
    Regards
    Gunaseelan

  • Setting/Getting Parameter Values BEFORE and AFTER the param window loads

    Hi there. My name is William Sanchez. I posted this question on Brian Wheadon's blog because I'm not sure that what we're trying to accomplish can be currently done with 2008 Crystal Report Viewer  and was wondering if a future version will support this, or if we're just missing something. I've searched through the SDK and API and can't seem to find a solution. Here's what we're trying to accomplish
    In a nutsheel: we think we need to hook into Crystal Report Viewer's parameter window from our WPF app.
    What we need to do is to be able to pass a set of default values to our parameters AND, after that's done programmatically, still display the parameter window for the report. Currently, however, after you do:
    parameterFieldDefinition.ApplyCurrentValues(currentParameterValues);
    it's as if Crystal says: Ok, we got the value, there's no need to show the parameter window anymore. This makes sense, but we need to still be able to show the parameter window to the user because all we did (from our point of view) is to pass in a default "choice". If we were to call ApplyDefaultValues() instead, the actual choices for the parameter are overriden. We basically want to make a default choice for the user from the allowed values for that parameter. But we want to still present the parameter window with the default choice already selected, plus all the other choices available for that parameter. If the crystal report has parameter1 set to false as default, we might want to programmatically set it to true, but still show false as an option on the parameter window.
    Part 2 of what we'd like to accomplish is that after the user changes any of the parameter values, and clicks OK to view the report, we'd like to catch the new parameter values in code to do something with them.
    This is why we're thinking of hooking into the parameter window so that we can tell it what we want both BEFORE it loads and AFTER the user is done...just like we can hook into the CrystalReportViewer refresh button like this:
    CrystalReportsViewer.ReportRefresh += new CrystalDecisions.Windows.Forms.RefreshEventHandler(CrystalReportsViewer_ReportRefresh);
    Our app is a WPF C# .NET 3.5 desktop application. Any assistance or direction will surely be appreciated.
    Kinds Regards,
    William Sanchez
    Edited by: wsanchez78 on Mar 31, 2010 1:20 AM

    Good day Ted, thanks for your reply.
    I did try Parameter.Default value, but what it does is as I mentioned above. If I have Parameter1 as a boolean, with possible values of true and false, if I set Paramter1.Default = true, the parameter window does come up, but it removed the false option from the drop down. So this is not a way to pick one of the various values for Parameter1, but to default it to only one of the values. It's close to what we need, but not fully.
    Also, what are your thoughts about getting the parameter values after the user has made their changes to the CrystalReportViewer parameter window and click OK to pass them to the report. How can we programmatically get those new values?

  • Get value before print anything

    Hello guys,
    I would like to know, how to get a value from database BEFORE the form starts any printing. I mean, where do I have to put my code?
    Or what part of a form, is executed first (before printing) so I can put my code right there,
    Thanks,

    you need write print program,you get the data from tables to internal tables.
    then you pass internal table data to Smartform FM.
    Use Example code :
    Program :   SF_EXAMPLE_01
    Smartform :   SF_EXAMPLE_01
    Reward Points if it is useful
    Thanks
    Seshu

  • Change item value before commit

    Hello,
    I have a form in which I issue an execute_query from a mouse click to retrieve database values from a data block onto a form. The user is then able to change the values of these items on the form and commit them via a button on the form. What I want to do is make sure that some of the values, based on another item in the block, are negative and if not, change them to a negative value. before the changes are commited. I can't seem to find the right trigger to accomplish this-- has anyone have an idea on how to do this?
    Thanks in advance.
    Jeff

    Hi,
    How about putting your code in :
    1. Pre-Update or
    2. When-Database-Record
    [Block Level trigger]
    The trigger text could be something like :
    If (:block.col is > 0 ) Then
    :block.col := :block.col * -1;
    End If;
    -- Shailender Mehta --

  • Need to call SET ROLE for Oracle before running report

    Hi all,
    does anyone know how I can call SET ROLE for Oracle with Crystal Reports, before running report? I'm using Crystal Reports 2008 to design report (with Server Oracle connection) and Java Reporting Component to run report within a J2EE apllication. If anyone has any idea, I'd greatly appreciate as I'm in trouble.
    Thanks a lot.

    Just a thought...
    If your report's datasource was an Oracle stored procedure, you could call a function to set the role from that SP
    You would be in the same Oracle session from  Report --> SP --> Function, so the role would be retained

  • How to refresh list item values before report is run?

    We have two SELECT LIST items (drop boxes) on our report. One SELECT LIST has values of "World Region" (e.g. NORTH AMERICA, SOUTH AMERICA, EUROPE, ASIA)
    the other SELECT LIST has values of "Subregion" (e.g. NORTHERN EUROPE, SOUTHERN EUROPE, SOUTHEAST ASIA etc...)
    The values in the Subregion list are dependent on the value that is chosen from the "World Region" List. Can someone tell up how to update the values in the Subregion list BEFORE we submit the page? We can get these values to update (via sql query) when the page is submitted but that is only happening after the report gets run- which is not what we want. We want the user to select a Region from one SELECT LIST and then see all the qualifying Subregions for that Region in the Subregion SELECT LIST. Only after both Region and Subregion have been selected do we want to run the report. Thank for any help on this.

    hey john--
    john) things like Scott's reference to "The name of the LOV Item". What does this really mean?
    raj) in htmldb there's a concept of items at the page and at the app level. page level items have ui component associated with them. in scott's explanation above, he's talking about using a page-level item with a "Display as" type of "select list w/submit" for your first select list. in that case, he's suggesting you have one select list item drive the values of another. when the self-submitting select list submits the page, it sets an htmldb built-in variable called :REQUEST to the name of the self-submitting select list item. in your follow-up post's example, that'd be "REGION_LIST". scott was explaining how you could control the functionality on your page by adding conditions to things like...
    :REQUEST = 'REGION_LIST'
    ...or using declarative Condition options like "Request = Expression 1" and then putting the string "REGION_LIST" in that Expression1 field. so in your case, you have a report region that you don't want displayed until the user's done selecting from your Subregion list. an easy way to handle that would be to add a hidden item (where "Display as" is set to "Hidden") to your page, for example :P1_LAST_REQUEST, to store the last value of :REQUEST. put a Computation on your page that populates :P1_LAST_REQUEST with :REQUEST each time the page is submitted. then put a Condition on your report region that makes it only render when :P1_LAST_REQUEST != 'REGION_LIST'. so this way your users can select a Region and have the page submit itself. the page will then redraw with the values of subregion list correctly populated (you'd presumably use :REGION_LIST in your subregion LOV query to achieve the filtered values) w/o your report region displayed. the user would then select a correct subregion and click some sort of "run my report" button. this time when the page redraws, :P1_LAST_REQUEST would be set so something other than "REGION_LIST" (it'd be set to whatever you named your "run my report button") and so your report region would display as desired.
    hope this helps,
    raj

  • Set Page item value when paging through an sql query report

    I have a report that includes a checkbox to indicate which rows a process is to be run on. I have a "Select All" button that sets a value to check all boxes in the report, and deselect button to turn that feature off. The page only renders one of the buttons at a time depanding on the value. If the "Select All" is turned on, I would like to set the value to "OFF" when a user goes to another page of the report.
    For example:
    A user enters the page and the report is rendered. The rows returned are greater than what is displayed. The paging options for the report are shown. 1-15 16-30 etc. It is currently showing the first 15 rows of the report.
    The user clicks the select all button, and all checkboxes are now checked. Currently it will remain this way until the deselect button is clicked.
    When the user clicks the report paging, I would like to set the value of the Select All item to off.
    Does anyone know how to do this at this point?

    Hi,
    Try Scott's suggestion in Re: How to get query from region "PL/SQL function body returning string query"?
    Andy

  • Changing Item Values before saving Purchase Requisition in me51n, set_data function

    Hello,
            I have written a user exit, which is called whenever changes are made to a purchase requisition. User Exit is MEREQ001 , function module EXIT_SAPLMEREQ_010 . My requirement here is that the Requisitioner should be 135 for every PR item under certain conditions. Therefore whenever there is any change made to the PR, before saving the PR item, I need to set the Requisitioner to 135, give a status message saying that the Requisitioner is set to 135 and save the Pr with the changed values. Following is the code I have written in EXIT_SAPLMEREQ_010. However, the set_data function called below does not change the PR values. Pls help
    data: lt_item type mmpur_requisition_items,
           wa_item type mmpur_requisition_item,
           wa_itemdet type mereq_item,
           wa_itemref type ref to if_purchase_requisition_item,
           w_message type i.
    constants: c_135 type afnam value '135'.
    call method im_req_header->get_items
         receiving
                 re_items = lt_item.
        loop at lt_item into wa_item.
         wa_itemref = wa_item-item.
         wa_itemdet = wa_itemref->get_data( ).
         if wa_itemdet-afnam ne c_135.
           w_message = 1.
           wa_itemdet-afnam = c_135.
           call method wa_itemref->set_data( wa_itemdet ).
         endif.
       endloop.
      IF w_message = 1.
        MESSAGE 'Requisitioner defaulted to 135 for all items' TYPE 'I'.
      ENDIF.

    Hi Sachin,
               I am able to get a reference to if_purchase_requisition_item in my code (wa_itemref ) and am also able to access each of the line items in the PR in the work area wa_itemdet.
    At this point in the code ( wa_itemdet-afnam = c_135 ) , the work area value is set to '135', However, call method wa_itemref->set_data( wa_itemdet ), does not change the values of the work area wa_itemdet . Pls help

  • How to set Default DateTime values in Crystal Reports 2008

    Hi All,
    I'm using Crystal Reports 2008. I have two fields FromDate and ToDate in reports. While running report, FromDate field should be displayed with CurrentDate + 00:00:00 in the UI and for ToDate it should be displayed with CurrentDate + 23:59:59 format.
    I have tried the below things, But still I want to set CurrentDate + 00:00:00 time in DateTime field.
    "In CR 2008 you would set the time portion to 00:00:00 in this way:
    1) Edit the date/time parameter and look for the 'Default Value' option; it would be blank
    2) Set this to 00:00:00
    This would default the calendar to 12/30/1899 00:00:00. The only worry here is, when you click on the calendar icon you would be presented with the calendar for the year 1899 and it is painstaking to scroll all the way to the current year."
    I found one solution in SAP forum and I have added the below lines in Record Selection formula,
    {@FromDate} = date(@CurrentDate)+time(00,00,00)
    {@ToDate} = date(@CurrentDate)+time(23,59,59)
    When I run the report, I still getting the empty values in the input parameters screen.
    Am I missing anything? Kindly help
    Thanks,
    Ramesh Kumar G.

    See the following for samples:
    Java (Crystal Reports for Eclipse) SDK - Business Intelligence (BusinessObjects) - SCN Wiki
    BusinessObjects Enterprise / SAP BusinessObjects Business Intelligence Platform 4.x Java SDK Applications
    Business Objects / BI Unmanaged Java RAS SDK Sample Applications
    Developer Help Files:
    Crystal Reports SDK
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Trying to set application item value through javascript

    Hi,
    I am not sure what I am doing wrong here can someone possibly shed some light? I have the following in my
    HTML Header of my login page
    <script language="JavaScript1.1" type="text/javascript">
    function setAppItem(val){
      var req = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=dummy', 
      &APP_PAGE_ID.);
      req.add('F_LOGIN_MESSAGE', val);
      var gReturn = req.get();
      req = null;
    </script>
    <script language="JavaScript1.1" type="text/javascript">
    function doLogin()
      var err = false;
      alert(document.getElementById('P101_USERNAME').value);
      if((document.getElementById('P101_USERNAME').value == '') ||
        (document.getElementById('P101_PASSWORD').value == '')) {
        setAppItem('You must enter a username and password.');
        err = true;
      if(!err) {
        doSubmit('Login');
    </script>The setAppItem function does get called but it is not setting the application items text?
    Thanks in advance for any help!

    Thanks for all of your help Jari it is appreciated!
    For others the solution was to add the following to my HTML Source
    <div id="LOGIN_MESSAGE"></div>and then created the javascript routine
    <script language="JavaScript1.1" type="text/javascript">
    function setAppItem(val)
      $x('LOGIN_MESSAGE').innerHTML=val;
    function doLogin()
      var err = false;
      if($v('P101_USERNAME') == '' || $v('P101_PASSWORD') == '')
        setAppItem('You must enter a username and password.');
        err = true;
      if(!err)
        doSubmit('Login');
    </script>
    Thanks

  • Validation of Item Values before saving the form

    Hi,
    I have requirement in Oracle Forms, we give header information as per the requirement and the lines info of the specific header. In lines whe have two feild as type and amount. If the type is 'E' then we need to sum up the amount value as credit and if type is 'F' we need to sum up of those feild values as Debit and before saving the form we need to check the sum of Credit and Debit is equal or not if equal then we should allow to save the form else it should not. We can have multiple lines under single header..Can any body help on this..Its very emergency..
    Thanks,
    Maggi.

    Hi,
    In Customer-exit ILOM0001 read table IMPT_BUF[] from sap stack. It contains all enteries of measuring points.
    Use below mentioned code in above exits for your reference.
    FIELD-SYMBOLS : <fs_impt> type ANY TABLE.
    data : tab_impt type TABLE OF impt.
    ASSIGN ('(SAPLIMR0)IMPT_BUF[]') to <fs_impt>.
    if sy-subrc is INITIAL.
      tab_impt = <fs_impt>.
    endif.
    table TAB_IMPT is filled wilth all entries of measuring point while creating and changing functional location.
    Thanks,
    Vijay

  • Item Values Not Set - Dynamic SQL Fails to Parse.

    ** Think I've fixed this **
    (By simply defining some page computations I was able to set the item values to some default. Please don't feel the need to reply :-))
    I have a page consisting of 5 report parameters and a report, all in one region, 4 parameters are LOVs and one is a text field which in the query are all compared to table column values. The report region type is SQL Query(PL/SQL function body returning SQL Query).
    If I load the page in a new session with default values for the LOVs as '%' and a null text field, I get the following error message:-
    failed to parse SQL query:
    ORA-00936: missing expression
    If I examine the session state, I see that none of the parameter values are set, which is probably why the dynamic sql is failing.
    If I set one of the parameters to something, eg. choose another value in an LOV or type some text in the text field, and re-run the report, it executes without error.
    What's the easiest way to fix this, is it to set the page items to some specific values when the page is first loaded? If so how do I do that? I'm not having much luck creating some process to do it.
    All help appreciated.
    Ian
    Message was edited by:
    Ian_F

    Hi Ian,
    Did you already try to put a default value for that lov?
    Or try to do a computation before header?
    Thanks,
    Dimitri
    -- http://dgielis.blogspot.com
    -- http://apex-evangelists.com

  • How to set item values without using fields in branch's ACTION block?

    Okay, I will try to say this in a easy way so it is not weird.
    I have created a button, SAVE, that has a Branch of branch type: Branch To Function Returning A Page. This is my code for the branch:
    if :P2008_NAP_SUPPORTING_MATERIALS = 'Yes' then
    return '2092';
    else
    return '2040';
    end if;
    The code for this type of branch is stored in the ACTION block of the Branch page. The ACTION block for a Branch of branch type: Branch To Function Returning A Page is different than the ACTION block for a Branch of branch type: Branch To Page Or URL.
    I need to set some item values with some specific values, which I can do with a branch type: Branch To Page Or URL. This is not possible with the branch type: Branch To Function Returning A Page. The ACTION block is totally different.
    How can I set some values on say Page 2040 from Page 2008 without using fields in the branch's ACTION block?
    Thank you in advance,
    Maggie

    Andy and Scott,
    I love seeing different perspectives in solving problems, it opens my eyes to new ways of looking at/using the tools (reserved words and 'Function returning a Page', etc.).
    One of my pet peeves has been that on branches I was limited to only 10 variables to be passed (I know, who would want more - but there was an instance where I had to pass more), and an even more frustrating time when using report Column Linking, which limits me to 3 variables.
    At least with the Branch linking I can use your suggestion Andy and add the variable setting statements into the function. I am assuming of course (and I should be able to) that I will be able to set more that 10 variables in a IF condition prior to the RETURN statement. This method will be much more understandable, for me, when looking through the branch at a later time to see what is happening, than an URL link where all the variable are strung out 'in a line' so to speak.
    I will still need to use URL Target branching on Links contained within a Column Attribute when I need to pass more than 3 variables, of which I have several places where I do this.
    Thomas

  • 2.2 item values passing w oracle reports

    Since upgrading from 1.6 to 2.2, The url to an oracle report does not pass the item value to the report.. also, it drops the item value and just leaves the &. This was working fine in 1.6...
    This is my link in htmldb:
    http://apps.mytxi.com/reports/rwservlet?report=e:\\prod\\reports\\agg_production.rdf&server=schedserver&destype=cache&desformat=pdf&cmdkey=dbuser1&P18_LOB=&P8_LOB.&p18_tkt_loc=&P8_TKT_LOC.&p18_date99=&P8_DATE99.&p8_draft_approval=&P8_DRAFT_APPROVAL."
    and this is what it does when you call the report:
    http://apps.mytxi.com/reports/rwservlet?report=e:\\prod\\reports\\agg_production.rdf&server=schedserver&destype=cache&desformat=pdf&cmdkey=dbuser1&P18_LOB=&p18_tkt_loc=&p18_date99=&p8_draft_approval=
    any help will be greatly appreciated...
    thanks

    Steve - Try upper-casing each item value expression (&P18_TKT. instead of &p18_tkt.) and see if that fixes it. If it does, then check the setting of Exact Substitutions in the application's attributes. If that is No, set it to Yes. If it was No and you change it to Yes, you should then be able to use the original link you were using with the lower-case expressions. However it you find the setting to be No and upper-casing the expressions doesn't help or if you find the setting to be Yes or you change it to Yes and neither lower-case nor upper-case expressions work, we will have to look into it further. If you do change the setting from No to Yes, you will have to locate all item name expressions in your application that might not have the trailing period and add the period.
    Scott

Maybe you are looking for