Dates in column headers based on passed-in parameters

I am trying to display a query that views performance data for a specified time range, with one day per column and the day's notation ('MON-DD') in the column header. Instead of giving myself a nightmarish query with a variable number of columns, I am starting with just 2 weeks worth and using DATE, DATE-1, DATE-2, etc. to derive the column data.
I can get everything to display just fine if I use SYSDATE, or just DATE, but I can't seem to figure out how to use DATE -1, etc. in the column headers. I have even tried creating hidden page items to calculate DATE -1 and referencing those in the column headers, but while the references work fine, the calculations error out. Again, the data is fine, it is just the column headers I am struggling with.
Thanks for any ideas.

The SYSDATE - 1, SYDATE -2 works great in the report I have that goes back two weeks from the current day. The one I am stuck on is an alternate version of the report where I need it to go back 2 weeks from a date I let the user supply. This is the part that is killing me. SYSDATE -1 etc, processes just fine, but I can't figure out the syntax, etc. for using a page item instead of a constant/predefined SQL query.
The posted idea is also what I currently use in the working report and is brilliant. What I can't seem to get figured out is how to populate the hidden items with calculated values based on a page item (the passed in date).

Similar Messages

  • How to export data with column headers in sql server 2008 with bcp command?

    Hi all,
    I want know "how to export data with column headers in sql server 2008 with bcp command", I know how to import data with import and export wizard. when i
    am trying to import data with bcp command data has been copied but column names are not came.
    I am using the below query:-
    EXEC master..xp_cmdshell
    'BCP "SELECT  * FROM   [tempdb].[dbo].[VBAS_ErrorLog] " QUERYOUT "D:\Temp\SQLServer.log" -c -t , -T -S SERVER-A'
    Thanks,
    SAAD.

    Hi All,
    I have done as per your suggestion but here i have face the below problem, in print statment it give correct query, in EXEC ( EXEC master..xp_cmdshell @BCPCMD) it was displayed error message like below
    DECLARE @BCPCMD
    nvarchar(4000)
    DECLARE @BCPCMD1
    nvarchar(4000)
    DECLARE @BCPCMD2
    nvarchar(4000)
    DECLARE @SQLEXPRESS
    varchar(50)
    DECLARE @filepath
    nvarchar(150),@SQLServer
    varchar(50)
    SET @filepath
    = N'"D:\Temp\LDH_SQLErrorlog_'+CAST(YEAR(GETDATE())
    as varchar(4))
    +RIGHT('00'+CAST(MONTH(GETDATE())
    as varchar(2)),2)
    +RIGHT('00'+CAST(DAY(GETDATE())
    as varchar(2)),2)+'.log" '
    Set @SQLServer
    =(SELECT
    @@SERVERNAME)
    SELECT @BCPCMD1
    = '''BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT '
    SELECT @BCPCMD2
    = '-c -t , -T -S '
    + @SQLServer + 
    SET @BCPCMD
    = @BCPCMD1+ @filepath 
    + @BCPCMD2
    Print @BCPCMD
    -- Print out below
    'BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername'
    EXEC
    master..xp_cmdshell
    @BCPCMD
      ''BCP' is not recognized as an internal or external command,
    operable program or batch file.
    NULL
    if i copy the print ourt put like below and excecute the CMD it was working fine, could you please suggest me what is the problem in above query.
    EXEC
    master..xp_cmdshell
    'BCP "SELECT  * FROM  
    [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername '
    Thanks, SAAD.

  • Displaying dates as column headers for BEx Query

    Hi all,
    I have to display dates in sequence as descriptions for 15 columns based on the keyed in date in Bex Query Analyser. I'm able to display date as column heading for one column using text variable with replacement path.I could not able to increment date for other descriptions.Could you please help me to solve this issue.
    Ex: Input Date 05/09/2007 then in the out put column headers should be 0509 0609    0709   ............ 1909
    These are only column headers, values for the columns are quantities calculated using formulas.
    It is urgent.
    Thanks in advance.
    Regards,
    Mandadi.

    hi mandadi,
    if u want dates as headers only then u should use a text variable .
    as a rule u can not set off set for text variable so u create restricted key figure with date restricted and set off set.
    now u use this rkf to populate the text variable using replacement path.
    text variable can use replacement path for replacing from any variable and characteristics.
    bye

  • SQL Developer: How do I copy data with Column Headers from the output grid?

    Hello,
    I am using Version 2.1.1.64.
    I run a SQL query, I get the results grid in the "Query Result" window down below. Say I get 10 rows returned, with 5 columns.
    I want to Copy this entire grid, plus the column headers/names, to the clipboard. So I can paste it under the original query to document the results of that query.
    I can't find any way to do this. I can copy/paste the results grid, but it doesn't copy the headers.
    The only way I see to do it is to go through numerous steps to Export to a TXT file, then paste that. Unfortunately, that is a lot of wasted steps if I need to do this over and over, plus, the output gets pasted in an ugly format with double quotes, etc.
    It seems like the simplest functionality is to copy/paste the entire results grid, and of course you might the headers. Why is this so complicated/impossible to do?
    (I believe Toad has the same problem. DBArtisan allows you to copy/paste the entire results, plus headers, though.)
    Any assistance would be appreciated!
    Thanks,
    John

    Ah, ok...
    I had tried that before, and it didn't work, it seemed to copy the path of filename I was using. But I think that was because I had clicked on a Column Header first, and it had asked me if I wanted to filter. I think then it lost track that it was in the grid. It's a little flukey.
    What I did now was to click on an individual cell in the output, then hit CTRL-A to select all, then hit SHIFT-CTRL-C. That gives me exactly what I want.
    Thanks very much for your quick solution, I appreciate it!
    John

  • Column headers and data are mismatched in Data tab of views after move col.

    Hi,
    Currently, I am using Windows XP, SQL Developer Version 1.2.1 Build Main 32.13.
    Java platform 1.5.0_06
    Oracle IDE 1.2.1.3213
    I'm having trouble with display of data from views in the "Data" tab of SQL Developer. If I move a column left or right of its original place, the data no longer line up with the proper column heading. The data are in the correct order, but the column headers are out of whack. Also, in the Single Record View, the data and column headers are mismatched.
    Refreshing the view, closing the view, closing and reopening SQL Developer do not "reset" the view so that the data and proper column headers are lined up. Even dropping and recreating the view does not force SQL Developer to use the proper data-column header match.
    Just to be clear, the data within the view is fine. It is the display of the data-column headers in the "Data" tab of SQL Developer (and the single record view) that is wrong. The mismatch seems to occur after a column is moved in the view.
    Is this a bug? I like the ability to move columns around within the display of the view. However, much more important that the column headers and data line up correctly.
    Thanks,
    Morgan

    Thanks much. I found the correct file, deleted it, and the column headers and data match up again.
    I found the correct file by searching the directory for one of the column names that occurs in the view (though I had to find both instances of "COLUMN_NAME" and "COLUMN NAME" (without the underscore)). Not sure why there were files with both versions.
    Do you know if there is any way to prevent those XXXXXXXXXTableSettings.xml files from writing all together (oracle.javatools.controls.nicetable.NiceTablePersistentSettings)? I looked through the SQL Developer preferences but nothing jumped out as being the setting to switch off.
    Should I be doing anything in particular to bring more attention to this potential bug so it might get fixed in a future release?
    Thanks again,
    Morgan

  • Assigning Column Headers Dynamically in ALV output

    Hello Experts,
    I have to create dynamic column headers based on the user input on the selection-screen. Basically users enter the period and the ALV output has to create the column headers dynamically for that along with some standard columns.
    For eg, The selection screen is like this:
    From:  'Q4' '2009'
    To      'Q2'  '2011'.
    Then I have to create 12 columns for the months and rest for the Quarters.
    Then the output will be like this:
    Material, Description,10/09, 11/09, 12/09, 01/10, 02/10, 03/10, 04/10, 05/10, 06/10, 07/10, 08/10, 09/10, Q4/10, Q1/11, Q2/11
    I have built the logic to determine the number of colums for the periods based on input.
    By reading other posts, I have learnt that I have to use call method cl_alv_table_create=>create_dynamic_table to get the functionality.
    I have also looked at program BCALV_TABLE_CREATE for some help. It only has column headers in increasing order. But I am not able to understand How to pass the Column Header Label (for eg 10/09 or Q1/10) to the fieldcat dynamically.
    Is there any blog/sample prog close to my req? Can anybody please please help me. I grealy appreciate it.
    Thanks.

    Hi Lope,
    You need to filll column heading based on dynamic internal table column names.
    In your final internal table, you will have some column names like '1009, 1109, 1209' .
    While filling fieldcatalog you need to put your logic for column heading text.
    If column name is 1009, concatenate '10 '  '/'   '09', or calculate the quarter 10 falls into ,and display Q4/09.
    Regards,
    Nisha Vengal.

  • Repeated column headers in Crosstab report when exported to Excel

    I have created a Cross tab report and wanted to export it in the format "Microsoft Excel(97-2003) (*.xls)", as the formatting of the report is lost in Excel  Data Only format. But when I export the data the column headers are repeated in the Excel. Is there any solution to avoid repeated column headers without losing the formatting of layout?

    I suppose one answer we should have before anything else;
    Does the export work from the CR designer?
    You may also want to see the following:
    How to WYSIWYG SAP Crystal Reports Export to XLS
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Change Data Table column header color

    How do I change the background color displayed in data table column headers?

    Thanks for your response. Problem is that I'm creating a portlet and the stylesheet.css file does not appear to exist, so Winston's blog does not help.

  • How Do I cahnge lables(column headers) dynamically?

    Hi,
    Dynamically, how do I change column headers based on some other value is the report?
    Thanks

    If the value you want as the column header is in the XML use the element.
    If you want different column headers based on a particular element in the XML then use conditional logic (if or when) wrapped around the column headers to do the selection at run time. See the user guide for examples of conditional processing in the template.
    cheers,
    Dave

  • Calling custom form to standard form based on passing parameters by pers..

    Hi Everyone,
    I have a urgent requirement related to form personalization like Calling custom form to standard form based on passing some parameters and after click on save icon then custom form should be enable and open. how to achieve this functionality through personalization.
    In brief ......Responsibilty -> Enterprise Asset Management->work order form and in this form's tool menu attach a custom form which comes other responsibility(here no issue) issue is that which trigger and condition used and what should be Action attribute/option. How to disable or enable tool form on some specific navigating the form.
    and how pass the parameter through current using form fields.
    plz help me out........it's urgent.
    thanks,
    Abh....

    Abh,
    Forms Personalization is a feature of the Oracle Enterprise Business Suite (EBS) not a feature of Oracle Forms. Please post your question in the General EBS Discussion forum. If you have a general Forms question, by all means, ask it here! ;-)
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Create column headers in report based on data entered in Form

    Hi,
    I have a form with following fields being entered into a table: -- a start date for a project and then projected hours required on a monthly basis for X months
    Start Date mnth1_resource mnth2_resource mnth3_resource ...
    2/12/2011 30 20 80 ...
    6/3/2011 80 30 70
    3/12/2011 50 70 60
    4/10/2011 40 120 90
    I would like to create a report (interactive or otherwise) that will provide headers for the actual months of the calendar showing the full range of months to cover the dates included in the data: e.g. if the above data was the only data entered then:
    Feb Mar Apr May Jun Jul Aug Sept
    30 20 80
    50 70 60
    40 120 90
    80 30 70
    Where mnth1 is the month of the start of the project--
    Would appreciate any hints on how to accomplish this.
    Thanks,
    Pat

    Hi,
    Thanks for the response. I see how a crosstab type report works great for data that is static and all in the table, however, in my case the issue is that the columns will vary depending on the start date of the project. So even though the user is only entering 12 months of projection, the total number of columns will depend on the start date of the latest project. For example, if a project does not start till June of 2011 and goes out 12 months, the actual column headers will need to go out to May 2012. Likewise the first column will be dependent on the earliest start date month-- like Feb 2011 in the sample data.
    Pat

  • Modifying based columns headers in JSP frames

    Using JDeveloper 3.1, I' have generated a JSP project based on a data module. However, I haven' t found how to change the column headers, in the generated frames. Is it possible to do this?

    Thanks to myself, I' ve found a way:
    1/ if you use the DataWebBean "RowSetBrowser"
    you can use the method "setAttributeTitle(attributeName, theTitle_you_want);"
    2/ if you use "ViewCurrentRecord"(=VCR here) you can
    -a) create a new webbean,
    -b)copy the source from the VCR in your new bean
    -c) add the setAttributeTitle method from the
    "RowSetBrowser" bean with the class and attribute(variables) required (the compiler will tell you this !!!)
    -d) invoke the "setattributetitle" method in the "Render" method of your new bean by adding the following code:
    if ( colTitles.get(sHeader) != null )
    sHeader =(String)colTitles.get(sHeader);
    after these lines:
    for(int attrNo = 0; attrNo < attrs.length ; attrNo++)
    if(!shouldDisplayAttribute(attrs[attrNo]))
    continue;
    sHeader = attrs[attrNo].getName();
    Then, when you use the JSP element Wizard
    add the "xxx.setAttributeTitle(defaultTitle, yourTitle)
    where xxx is your bean Id
    That's it
    null

  • How to make column headers in table in PDF report appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp

    Hi my name is vishal
    For past 10 days i have been breaking my head on how to make column headers in table appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp.
    Given below is my code in c# on how i export datas from different tables in sql server to PDF report using iTextSharp:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.Diagnostics;
    using System.IO;
    namespace DRRS_CSharp
    public partial class frmPDF : Form
    public frmPDF()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(6);
    table.TotalWidth =530f;
    table.LockedWidth = true;
    PdfPCell cell = new PdfPCell(new Phrase("Institute/Hospital:AIIMS,NEW DELHI", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK)));
    cell.Colspan = 6;
    cell.HorizontalAlignment = 0;
    table.AddCell(cell);
    Paragraph para=new Paragraph("DCS Clinical Record-Assigned Dialyzer",FontFactory.GetFont("Arial",16,iTextSharp.text.Font.BOLD,BaseColor.BLACK));
    para.Alignment = Element.ALIGN_CENTER;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(105f, 105f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select d.dialyserID,r.errorCode,r.dialysis_date,pn.patient_first_name,pn.patient_last_name,d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.Technician_first_name,t.Technician_last_name from dialyser d,patient_name pn,reprocessor r,Techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=0 and d.closed_status=0 and pn.status=1 and r.errorCode<106 and r.reprocessor_id in (Select max(reprocessor_id) from reprocessor where dialyzer_id=d.dialyserID) order by pn.patient_first_name,pn.patient_last_name", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("Reprocessing Date");
    table.AddCell("Patient Name");
    table.AddCell("Dialyzer(Manufacturer,Size)");
    table.AddCell("No.of Reuse");
    table.AddCell("Verification");
    table.AddCell("DialyzerID");
    while (dr.Read())
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString() +"_"+ dr[4].ToString());
    table.AddCell(dr[5].ToString() + "-" + dr[6].ToString());
    table.AddCell("@count".ToString());
    table.AddCell(dr[12].ToString() + "-" + dr[13].ToString());
    table.AddCell(dr[0].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    System.Diagnostics.Process.Start("AssignedDialyzer.pdf");
    if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.Yes)
    var writer2 = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    else if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.No)
    this.Close();
    The above code executes well with no problem at all!
    As you can see the file to which i create and save and open my pdf report is
    AssignedDialyzer.pdf.
    The column headers of table in pdf report from c# windows forms using iTextSharp are
    "Reprocessing Date","Patient Name","Dialyzer(Manufacturer,Size)","No.of Reuse","Verification" and
    "DialyzerID".
    However the problem i am facing is after execution and opening of document is my
    column headers in table in pdf report from
    c# and datas in it all appear in bold.
    I have browsed through net regarding to solve this problem but with no success.
    What i want is my pdf report from c# should be similar to following format which i was able to accomplish in vb6,adodb with MS access using iTextSharp.:
    Given below is report which i have achieved from vb6,adodb with MS access using iTextSharp
    I know that there has to be another way to solve my problem.I have browsed many articles in net regarding exporting sql datas to above format but with no success!
    Is there is any another way to solve to my problem on exporting sql datas from c# windows forms using iTextSharp to above format given in the picture/image above?!
    If so Then Can anyone tell me what modifications must i do in my c# code given above so that my pdf report from c# windows forms using iTextSharp will look similar to image/picture(pdf report) which i was able to accomplish from
    vb6,adodb with ms access using iTextSharp?
    I have approached Sound Forge.Net for help but with no success.
    I hope anyone/someone truly understands what i am trying to ask!
    I know i have to do lot of modifications in my c# code to achieve this level of perfection but i dont know how to do it.
    Can anyone help me please! Any help/guidance in solving this problem would be greatly appreciated.
    I hope i get a reply in terms of solving this problem.
    vishal

    Hi,
    About iTextSharp component issue , I think this case is off-topic in here.
    I suggest you consulting to compenent provider.
    http://sourceforge.net/projects/itextsharp/
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Export data to excel and table column headers

    I noticed that with LV 2012 when I call the method "Export Data to Excel" for a table, the table headers (= column names) are not exported to excel.
    Am I right? I think that the column names should be exported too...
    As a matter of fact when you call the method "Export to simplified image" the column names are included
    How can I export the table column names to excel?
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

    In this document there is a full description of how to export data from LabVIEW to Excel.
    Using a table, the method "Export data to excel" should export the "currently selected data", and data can be programmatically selected using ActiveCell property (as described here).
    With ActiveCell I can select the column headers too (using negative numbers for row and/or column), and I do this.
    And so I expect that when I select "Export data to Excel", the column headers should be exported too (because I selected them!).
    I think that the actual behavior is a bug, rather that an expected behavior.
    Don't you agree?
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

  • Discoverer Export Problem - Column headers dropped & row data used instead

    In Discoverer 9i, when I export the data for a 12 month period from one of my workbooks to Excel 2002, three of the twelve column headers are dropped in the spreadsheet and one piece of row data is used as a column header instead. The total number of records exported for the workbook is 33586 which is below the export limit for Excel. This problem does not happen when 11 months of data (28174 rows) is exported out to Excel. Any idea what may be causing this?
    Regards,
    Andrew

    pallen,
    As usual the Express VI has its limitations.  It seems to be setup for a 2D array of info in this case.  The best way I've found is to name range in template and use the Excel Easy Table.vi.

Maybe you are looking for

  • Integration between OM and PA

    Hello, I creating OM structure i ran the reports RHINTE10 and RHINTE30 respectively for transferring Org. units / positions and holders for the positions to Infotype 0001 in PA. But when i am checking the same in PA30 , IT 0001 the respective positio

  • Simple table mapping

    I have a source table and a target table with the same name in different schemas! How can I do to create a simple mapping between this table? Mapping editor raname the target table with suffix "_1" and the deploy procedure give me obviously an error

  • Pages on my Mac will not open iCloud documents.

    I am suddenly unable to open any of my saved documents on iCloud from Pages on my Mac. I can download them via the web app, and I can open them on my iphone. However, when I select the file in Pages on my Mac, then click open. Nothing happens.

  • Possible sampling rates of a PCI-MIO-16E-1 with DASYLab

    Hello! I'm using a PCI-MIO-16E-1 DAQ. It's maximum sample rate is 1.25MS/s My questions: - What does maximum output rate of 1MS/s mean? I need 3 channels at 400kS/s. - What are the possible sample rates? Can I use e.g. 3 channels with 105 kS/s each?

  • Zen Micro ~ Serious Problem with Synchronizat

    I have a Zen Micro with the 2.20.05 firmware update. I've tranfered around 3 GB onto the player using Napster to Go. However now, as of a couple of days ago, Windows Media Player is causing the Micro to freeze. Since then I've only been able to trans