Dynamically change the report column name.

Hi All,
I have a report where i am showing data for greater than current week and year and the code of same is below
SELECT
    item_number,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+1 THEN
                quantity
        END
    ) plus_1,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+2 THEN
                quantity
        END
    ) plus_2,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+3 THEN
                quantity
        END
    ) plus_3,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+4 THEN
                quantity
        END
    ) plus_4,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+5 THEN
                quantity
        END
    ) plus_5,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+6 THEN
                quantity
        END
    ) plus_6,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+7 THEN
                quantity
        END
    ) plus_7,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+8 THEN
                quantity
        END
    ) plus_8,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+9 THEN
                quantity
        END
    ) plus_9,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+10 THEN
                quantity
        END
    ) plus_10,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+11 THEN
                quantity
        END
    ) plus_11,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+12 THEN
                quantity
        END
    ) plus_12,
    SUM
    (   CASE
            WHEN year_week_num = to_number(to_char(sysdate,'IW'))+13 THEN
                quantity
        END
    ) plus_13     
FROM
    (   select
            re.item_number,
            row_gen.year_week_num,
            SUM(NVL(re.quantity,0)) OVER(PARTITION BY re.item_number ORDER BY row_gen.year_week_num) quantity,
            ROW_NUMBER() OVER(PARTITION BY re.item_number, row_gen.year_week_num ORDER BY NULL) rn
        from
            (   SELECT
                    to_number(to_char(sysdate,'IW')) + ROWNUM year_week_num
                FROM
                    DUAL
                CONNECT BY LEVEL <= 13
            ) row_gen LEFT OUTER JOIN
                    (   SELECT
                            le.item_number,
                            le.quantity,
                            to_number(to_char(sysdate,'IW'))+1 year_week_num
                        FROM
                            BACKLOG_WEEK_WH_AFTR_ATP le
                        UNION ALL
                        SELECT
                            re.item_number,
                            -re.quantity,
                            to_number(substr(re.year_week,-2,2)) year_week_num
                        FROM
                            BACKLOG_ATP_GT_CW re
                     ) re
                PARTITION BY (re.item_number)
                ON ( row_gen.year_week_num = re.year_week_num)
WHERE
    rn = 1
GROUP BY
    item_numberI have a item in the report page from which i am displaying which week this year holds and the code of same is below
In the item source, i have selected source type as sql query return single value. and the current week is returning as "2011-WK30"
select to_char(sysdate,'YYYY"-WK"IW') from dual;Please suggest how i can change the display of column dynamically. I want PLUS_1 to show as 2011-WK31, PLUS_2 to show as 2011-WK32 and so on for this week. When next week will come then the plus_1 should show as 2011-WK32, plus_2 to show as 2011-WK33.
Any help how to do this?
Thanks in advance
Regards

Hi,
Go to the Report Attributes, in the Column Attributes section:
1) Use Headings Type as PL/SQL.
2) In the text area Function returning colon delimited headings write a PL/SQL anonymous block returning colon delimited headings.
Hope it helps!
Regards,
Kiran

Similar Messages

  • Dynamically changing the report path

    Is there any way to dynamically change the path where the reports are saved. Teststand 4.1.1
    Message Edited by glennjammin on 04-21-2010 03:30 PM
    Test Engineer
    L-3 Communications
    Solved!
    Go to Solution.

    Yes you can run a VI in the ReportOptions Sequence, add it to the Setup of that sequence. If you dont use FileGlobals.Dated anywhere else then use a Local instead. Just remeber FileGlobals are only global to sequences that are contained in a SequenceFile. They are not global across SequenceFile unless you are using the Batch Process Model.
    You will probably have to set a number of other parameters up to work with ReportOptions.Directory. The best way to handle this is to setup up you exact conditions statically (ie via the Config | Report Options... menu ). Place a breakpoint in the ReportOptions (use a label if you dont have any steps in the ReportOptions sequence at the moment) and run your Sequence. Remeber to use Test UUTs or Single Pass. You dont have to use your full test sequence just create a simple one step sequence.
    When you reach the break point, then you can browse the Parameters.ReportOptions and see what properties are required to ensure your reports are setup correctly.
    Hope this helps.
    Regards
    Ray Farmer 
    Regards
    Ray Farmer

  • How can I change the report file name depending on which seq file is run in the main seq?

    I'm using TestStand 3.0.
    I have a main sequence file with a menu option to select one of several sequence files to run.
    How can I get TestStand to change report file name to the selected sequence file rather than the main sequence file name?
    Thanks
    Harminder

    Hi Harminder
    Try RunState.Root.Locals.ReportFilePath = "PathToMyFile.xxx"
    regards
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • Dynamically changing the layout of thre report-urgent please

    Can we change the layout of the report dynamically during runtime for example:the user should have flexibility to change the width, size , position of columns before the report is displayed & also he choose some fields not to display as per his discretion.
    Mahesh

    There are several ways of doing this, it really depends on your requirements as to which is suitable. (There are probably other ways of doing this as well).
    - Try Reports XML Customizations
    This is available in 6i and allows you to create a report dynamically on the fly. The template used will also allow you to change the paper size as well. The main limitation is that you are relying only on Reports defaulting to create the layout for you. The advantage is that you can store all your information to create the report in meta-data which can be driven by another tool.
    - Use lexical parameters for queries and format triggers
    Here, you have a fixed layout but dynamically change the query columns to the correct order. You would normally standardise on a "character" column type in order to do this. Even though the layout is fixed, you can use variable sized fields to push objects around. This can be difficult to setup.
    - Use several layouts
    You're reducing the options for the user, but you can have several layouts in the same report and turn them on/off. Effectively creating differing views of the same data.

  • How to create  some columns dynamically in the report designer depending upon the input selection

    Post Author: ekta
    CA Forum: Crystal Reports
    how  to create  some columns dynamically in the report designer depending upon the input selection 
    how  export  this dynamic  report in (pdf , xls,doc and rtf format)
    report format is as below:
    Element Codes
    1
    16
    14
    11
    19
    10
    2
    3
    Employee nos.
    Employee Name
    Normal
    RDO
    WC
    Breveavement
    LWOP
    Sick
    Carers leave
    AL
    O/T 1.5
    O/T 2.0
    Total Hours
    000004
    PHAN , Hanh Huynh
    68.40
    7.60
    76.00
    000010
    I , Jungue
    68.40
    7.60
    2.00
    5.00
    76.00
    000022
    GARFINKEL , Hersch
    66.30
    7.60
    2.10
    76.00
    In the above report first column and the last columns are fixed and the other columns are dynamic depending upon the input selection:
    if input selection is Normal and RDO then only 2 columns w'd be created and the other 2 fixed columns.
    Can anybody help me how do I design such report....
    Thanks

    Hi Developer life,
    According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
    As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric  values) in the details,  add  an filter to filter the data base on this column group, but if
    the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
    If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
    Similar threads with details steps for your reference:
    https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings 
    If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
    Any question, please feel free to let me know.
    Best Regards
    Vicky Liu

  • How to spilt columns dynamically in the report based on Date Parameters

    Hi All,
    We have an XML Publisher report in which the parameters are Fom date and To date.
    User wants the data in the report to be split dynamically based on the months in the From date and To date interval.
    Eg. if the From date is 01-JAN-2013 and To date is '31-MAR-2013' then the report should show 3 columns JAN,FEB and MAR and the corresponding data.
    if the From date is 01-JAN-2013 and To date is '31-MAY-2013' then the report should show 5 columns JAN,FEB,MAR,APR and MAY and the corresponding data.
    Can anyone please advise, how can we spilt the months and data dynamically in the report.
    Regards,
    Shruti

    well you wanted the columns to be added dynamically.  the easiest way would be to use a Pivot since the columns are based on the values in the data.  and if the values of that column are Month Name/Abbreviation for that date then you will get month columns.
    Have you worked with Pivots before?

  • How to change the sender's name/email-id in the scheduled report

    Hi,
    We have SCOM 2007 R2. In the Reporting tab (SCOM Console), we have some scheduled reports. I need to change the sender's name/email-id in a scheduled report. When we receive the report through email, receiving with the person's name who moved out of the
    team.
    I tried to change but could not find the option to change while editing the properties in SCOM Console under Reporting -> Scheduled Reports.
    When we are receiving mail from that scheduled report, instead of an individual name, would like to provide a generic name. Please help me out. Let me know, if you need more information.
    Thanks,
    Naren.
    Thanks & regards, Naren.

    Hello,
    the SCOM scheduled reports feature rely on SQL Reporting Services. So, if you would like to change the SMTP configuration, you should go in SQL Reporting Services Configuration Manager:
    Open in the Start Menu, Reporting Services Configuration Manager.
    In the connection window, click OK.
    Click on the tab E-mail settings.
    Change the Sender Address.
    Click Apply.
    Alternatively, you could also change in the Scheduled report properties the field
    Reply to. I think it should customize the reply address for each scheduled reports, but I have never used it. Anyway, doing it with Reporting Services Configuration Manager is more interesting in the long-run.

  • Dynamically changing the name of the .dll file to load in call Library

    Our current model is to use dll files as "plug-in" modules for instruments and a top layer test step calls the appropriate driver dll.
    For instance
    the TestStep is called with the kenmore.dll passed as a parameter so the kenmore.dll file is loaded, the functions are registered and the functions are called.  Next the TestStep is called with whirlpool.dll as a parameter now the whirlpool.dll is loaded the functions are registered and the functions are called.  This works very well in our current CVI/LabWindows environment.  Now we plan to work with LabView, we wish to retain this model (as DLL files, there are advantages in our model for us).  We have not found a way to load these dll files from LabView without hard coding the path and filenames in.
    Any suggestions on how to dynamically change the path in the Call Library module, or another suggested method of loading the dll via LabView?
    Thanks,

    John Stuart wrote:
    Our current model is to
    use dll files as "plug-in" modules for instruments and a top layer test
    step calls the appropriate driver dll.
    For instance
    the TestStep is called with the kenmore.dll passed as
    a parameter so the kenmore.dll file is loaded, the functions are
    registered and the functions are called.  Next the TestStep is
    called with whirlpool.dll as a parameter now the whirlpool.dll is
    loaded the functions are registered and the functions are called. 
    This works very well in our current CVI/LabWindows environment. 
    Now we plan to work with LabView, we wish to retain this model (as DLL
    files, there are advantages in our model for us).  We have not
    found a way to load these dll files from LabView without hard coding
    the path and filenames in.
    Any suggestions on how to dynamically change the path in the Call
    Library module, or another suggested method of loading the dll via
    LabView?
    Thanks,
    As Ben has pointed out LabVIEW
    scripting may be a possibility but you are going with that in highly
    unsupported area. Also I happen to know that changing the library name
    of a Call Library Node through scripting has produced unsupported
    feature errors previous to LabVIEW 7.1 eventhough the method was there.
    And LabVIEW 8 hides the whole scripting business behind the license
    manager.
    Another approach at least if the different DLLs do not change to often
    thier functions and parameters would be to create a wrapper DLL. Have
    it a method that loads the desired DLL and links its functions to
    internal function pointers. Then when calling the actual function entry
    points just redirect directly to the correct fucntion through that
    function pointer. Since you are already working in CVI creating such a
    DLL should be only a matter of taking out a little bit of your already
    existing code and put it into a DLL project.
    Rolf Kalbermatter
    Message Edited by rolfk on 04-12-2006 07:40 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Dynamically changing the flatfile name..

    Hi friends,
    I 'm Getting data from 30 Flat files...all are with same structure but different data.. .. all these files are now in Application server...
    now i want to upload data into with a single DataSource and to ODS with process chains..
    so, how can i dynamically change the file name in Data Source level.. i saw previous threads.. in that.. through Routines.. we can solve this problem.. but I dont know ABAP code... so, can any one plz give me the exact code.. what i have to write...exact coding..
    <b>
           I already post this question in forums.... but evry one gave different options.. some  one gave the function module..
    BAPI_IPACK_CHANGE    and BAPI_IPACK_START.
      and some one gave  other function module.. like .. EPS_GET_DIRECTORY_LISTING
    i tryd for All these options.. but i'm not getting the exact solution... even i'm unable to pass the parameters also.. beacuse.. in that function what parameters can i pass....</b>
    can u plz suggest me the solution..
    Thanks
    Babu

    Hi  Friends,
      for the above requirement i had write the bellow coding in the routine.. it is working.. but the problem is.. it was loading  only  the last file..(30 th file  data only..)
    data : z1(50) type c,
             z2 type c,
             z3(50) type c,
             z4(50) type c.
             Z2 = 1.
       Do 5 times.
              z1 = 'C:\Documents and Settings\e10035\Desktop\'.
              z3 = '.csv'.
              concatenate z1 z2 z3 into z4.
              p_filename = z4.
              z2 = z2 + 1.
        Enddo.
    SO, CAN YOU PLZ SUGGEST ME.. when ever the file name was changing in the loop.. that automatically should load into the  PSA ..
    plz... plz.... help regarding this..
    Bbau

  • Export from SP list to Excel: Excel doesn't show changed colum name. It shows only the original column names, which would be done by the column creation.

    Hello,
    I have an excel list with some columns. I changed the name of some of the column. When I export this list to excel, I always get the first column name, which was created by the creation of the column, and not the new one.
    Is there some possibility to export a SP list to export with the new column names?
    I'm waiting for your help,
    BR
    Damian

    Hi Damian,
    I tested in my environment, change the column name and export to excel list, the exported field name is the correct one.
    Please check the column name from somewhere else from site UI, you could check from SharePoint designer or powershell script.
    [system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
    $site= New-Object Microsoft.SharePoint.SPSite ("http://siteurl")
    $web=$site.OpenWeb()
    $list=$web.Lists["CustomList"]
    $list.Fields |select ID, title, internalname| more
    In addition, I wonder if the issue occurs to all lists or one specific list. If the issue only occurs to one list, please try to save this list as template and create a new list based on this list and test the issue again.
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • OBIEE 10g AGO Function Dynamically Change the Heading

    I created columns in my rpd named Sales Previous Month, Sales 2 months ago and Sales 3 months ago using the AGO Function. This is working fine.
    My problem is when displaying these headings the users would like to see the Month Name instead of the Headings I created. For example if looking at a report for January the users would like to see:
    Sales Previous Month = December
    Sales 2 Months ago = November
    Sales 3 Months ago = October
    Is there any way to dynamically change the value of the column header to show the name of the month?

    Hi SriniVEERAVALLI,
    Thanks for the reply. I have found that I might haven't created the relationship between dimension and fact tables correctly.
    I initially created the foreign key relationship (instead of creating complex join) in physical diagram between the dimension and fact table. And the relationship type is hence greyed out.
    I have deleted the foreign key relationship in physical diagram. Then
    1. In physical diagram, create complex join between dimension and fact . The relationship is 'inner' and can't be changed.
    2. In Logical table diagram, create foreign key between dimension and fact . The relationship can be changed (inner, outer, etc).
    Is this the correct way?
    I tried these on two newly created dummy tables and it worked.

  • How to dynamically change the text of a TextObject with embedded DataField?

    Hi
    I'm trying to dynamically change the text of a TextObject at runtime, by using the .NET library. My problem is that if one or more DatabaseFieldDefinition is embedded inside my text, I'm unable to change the "static text" only, by keeping the field, e.g. I have :
    Text1 => "Contact Name: {Contact.Name}"
    and I'd like to change it to anything else like:
    Text1 => "Nom du Contact: {Contact.Name}"
    Half of my TextObject is static text while second part comes from the dataset.
    (of course the translation is dynamic - it is called at run-time and the new value to be set depends on the calling application language)
    If I simply modify the Text property of my TextObject, the {Contact.Name} embedded field is not evaluated anymore by the Crystal Engine, but considered as a single text.
    Using formulas or parameters looks quite difficult, because it means having many ones just for translation needs - I cannot control the way my users will create their reports and "force them" to use complex methods just in order to put a text and a value together...
    Anyone knows how to deal with that ?

    Only way I can think of doing this:
    1) Create a formula (call it lang) and enter the string "Contact Name" in it
    2) Place the  {Contact.Name} field next to the string
    3) So now you have:
    ContactName:  {Contact.Name}
    4) Check what localization you are after. If you need "Nom du Contact", change the lang formula so it shows "Nom du Contact" using the code below:
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Public Class Form1
    Inherits System.Windows.Forms.Form
    Dim Report As New CrystalReport1()
    Dim FormulaFields As FormulaFieldDefinitions
    Dim FormulaField As FormulaFieldDefinition
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    FormulaFields = Report.DataDefinition.FormulaFields
    FormulaField = FormulaFields.Item(0)
    FormulaField.Text = "[formula text]"
    CrystalReportViewer1.ReportSource = Report
    End Sub
    I realize this may not give you consistent spacing as the translations may have strings of differnt length. Perhaps someone has other idea(s)...

  • Substitution string used in custom Report column name does not display in PDF version of report

    I am using Apex 4.2.6.00.03, Apex Listener 2 via Glassfish4 and have set up all my applications and reports on this system.  We previously used Oracle 10.2, with Apache with a custom fopping document.
    My issue is that I have a report that has custom column headings using a substitution string to pull in the begin or end date for the report.  When the report is run and displayed, the column headings appropriately display the date.  However, when I try to set up the Print to PDF option, the column headings are not displaying correctly.
    Is it possible to use a substitution string in the column heading?  I am able to use the substitution string in the Page Header and Page Footer and those display correctly.
    In the Report Attributes setup I have set the "Strip HTML" to Yes and I have four columns that are using the &"ITEM NAME". string.  See below for actual display:
    The report column headings in APEX displays correctly (bold is the substitution detail): 
    Fund    Account Description          Balance 07/01/2014     Budget/Goal FY 14-15     YTD Actual 02/28/2015         Ending Balance 02/28/2015
    In the Print Attributes setup, when I get to the Report Columns section, the Heading column displays the headings as set up in the Report Attributes custom and I am not able to edit these names.  See below:
    In the version of the report that is Printed to PDF I get the following for display:
    Fund           Account Description           Balance %26amp;P347_BEGIN_DATE.     Budget/Goal %26amp;P347_FY.     YTD Actual %26amp;P347_END_DATE.     Ending Balance %26amp;P347_END_DATE.
    Any assistance would be greatly appreciated.
    Thanks,
    Pat

    First, the misspelled word is a test object and not data.
    Second, all data display correctly.
    Third, text object is displaying the old misspelled word.
    Fourth, I have eliminated the possibility that problems in of my pdf export routine cause this issue by exporting directly from Crystal Reports Viewer. I print the report to the crystal report viewer. The report looks good. The text object is spelled correctly. Then I click the Crystal Reports viewer's export button in the left upper corner and I export to both EXCEL and PDF. The excel export looks good. The pdf export is misspelled. All the export occurs internally in Crystal reports.
    Fifth, I found outthat all users who have this problem have the ADOBE PDF writer installed. I am just suspicious that ADOBE writer is interferring with Crystal export
    Sixth, I cannot recreate this problem on any of our development and test machines. It only happens on end-user laptops.
    Seventh, I changed the name of the report that had this problem and created a new version and installed on end-user laptop. The behaviour still persists. User saved the report as both RPT and PDF. RPT export looks good. PDF version has the spelling problem. Data on both reports is up-to-date and good. I copied the same RPT export to my PC and exported it to PDF, the pdf looks good. That is why I think something on the end-users laptops is causing the export to use some cached template.
    One more thing I did was to change the report name in VB.NET project, recreated a new package and installed on end-user's laptop. The same exact problem is still there.
    I have worked with Crystal Reports more than 15 years and I have never such a weird behaviour before. I know this sounds very weird. We are all baffled by what is happening.

  • Question on changing the report template to display the images

    I am trying to change the report template so that each table cell will display an image and a checkbox for the image. The column templatet for the new report template is like this:
    <td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t17data">
    <table>
    <tr height="90%"><td>
    <img src= "&F101_GET_THUMB.#COLUMN_VALUE#" onmouseover="return onmouseover_img('#COLUMN_VALUE#');">
    </td></tr>
    <tr height="10%"><td align="center" valign="bottom">
    <input type="checkbox" name="f01" value="#COLUMN_VALUE#"/>
    </td></tr>
    </table>
    </td>
    My questions are:
    1. If the #COLUMN_VALUE# is null, the table cell will display a broken image icon and a checkbox. How could I avoid this? I could add condition to this template, such as when #COLUMN_VALUE# is not null, but how to refer to the value of #COLUMN_VALUE# in pl/sql?
    2. I want to always put the checkbox at the center bottom, but no matter what I set "align='center' valign='bottom', it is always close to the image. Since the image sizes are different, the appearance of the checkbox are just up and down. How to fix this?
    Thanks,
    Fengting

    hello,
    at designtime the elements from the template are physically
    imported into the report. the only way of re-applying a template
    is to use the wizard, which will re-default the layout.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Dynamically changing the content of the block

    Hi,
    We have a requirement as below :
    The form contains two blocks. The main block contains a dropdown which will show a list of tables (like emp, dept..etc). When the user will select a particular table, the second block should show the columns of that particular table.
    Please help me.
    Thanks,
    Tandra

    Hi Francois,
    Thanks for the response.
    I searched "Steve Cosner post about dynamic form" and found a reply from Chirag Patel as below :
    IF you have one block and 100 items. then
    you can change at run time everyhting to bring data from un known table
    you can change block property "QUERY DATASOURCE NAME" , "WHERE clause", "Order by" also
    and also you can change item property "Column Name" at runtime
    in control block you can populate list item with all tables then
    write following code on when-list-changed trigger
    clear_block;
    1) make visible off if any item is visible.
    2) then change all block property which i mentioned above.
    3) then fetch all column from all_tab_columns and change clolumn name property and disply those items in that block.
    execute_query;
    and i think if you use form built-in packges then you can also bring data for BLOB and Long dynamically !!!
    However i am not clear about the third point.
    Could you please explain this in detail?
    Thanks,
    Tandra

Maybe you are looking for