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?
Similar Messages
-
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....
ThanksHi 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 show the columns dynamically in OBIEE report based on the selection?
Hi,
I have a requirement where the columns should be dynamically shown in report based on what we select in propmt page.
I'm creating a report in OBIEE where i want to give an option to the end user to select the columns whichever he wants to see in the report.
For example I have the following columns in the report already:
Customer Name,
Customer Number,
Bank Account,
Address
I want to give an option to the user to select 'Customer Mail ID' dynamically and see the column to be displyed in the report along with the existing columns.
Through 'Column Selector' user can select a single column at a time, but if he want to select more than one column, how can we do this ?
Please help me out in resolving this issue.
Thanks,
Chaithanya.Hi Chaithanya,
there's not a straight solution for this. You can create different analysis containing different number of columns and then directing the user to this analysis using Action Links or you can also use View Selector to switch from one view (analysis) to the other. But it's not going to be very flexible nor dynamic.
J. -
How to select column dynamically with sharepoint list as data source in ssrs report
Hi all,
I am creating reports from SharePoint list but i have requirements to select the column name dynamically with SharePoint list as data source. I didn't find any way of doing this..
Can anyone help me to resolve this issue..
There is no way of specifying column name dynamically here in data set query
<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ListName>test list</ListName>
<ViewFields>
<FieldRef Name="ID" />
<FieldRef Name="ContentType" />
<FieldRef Name="Title" />
<FieldRef Name="Modified" />
<FieldRef Name="Created" />
<FieldRef Name="Author" />
<FieldRef Name="Editor" />
<FieldRef Name="_UIVersionString" />
<FieldRef Name="Attachments" />
<FieldRef Name="Edit" />
<FieldRef Name="LinkTitleNoMenu" />
<FieldRef Name="LinkTitle" />
<FieldRef Name="DocIcon" />
<FieldRef Name="ItemChildCount" />
<FieldRef Name="FolderChildCount" />
<FieldRef Name="test_x0020_date" />
<FieldRef Name="title2" />
</ViewFields>
</RSSharePointList>Hi MNRSPDev,
Sorry for the delay.
According to the current description, I understand that you want to specify column name in dataset query designer dynamically when using SharePoint list data source.
Based on my research, this is not supported by default. As a workaround, you can use XML data source. The XML content can be embedded directly within the query. This lets you use the expression capabilities within the processing engine to build queries and
data dynamically within the report. And it can be used for retrieving XML data directly from an external data source, passing it using parameters, and embedding it within the query.
Reference:
http://www.codeproject.com/Articles/56817/Dynamic-Reports-with-Reporting-Services
Hope this helps.
Regards,
Heidi Duan
Heidi Duan
TechNet Community Support -
Adding the columns dynamically in crystal report
Hi,
I am developing a application using asp.net and crystal report. In a report the column is created dynamically( ie, the report gets input from a sp which returns N no. of columns). Since i dont know the column name and no. of columns at design time i am not able to create the report. If any of you have any idea on adding the columns dynamically please send me the code or the link.
Thanks
SankarHello Sankar,
please see CS code for VS 2005 below to add a database field to a report using inproc RAS.
This sampels retrieves the table column name from the database and adds it to the report.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportAppServer.Controllers;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.DataDefModel;
namespace CS_Add_Field_inproc
public partial class Form1 : Form
// CR Declarations
ReportDocument boReportDocument;
ISCDReportClientDocument boReportClientDocument;
CrystalDecisions.ReportAppServer.ReportDefModel.Section boSection;
CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject boFieldObject;
public Form1()
InitializeComponent();
//Create a new ReportDocument
boReportDocument = new ReportDocument();
// load the RPT file
boReportDocument.Load("..
AddField.rpt");
//Access the ReportClientDocument in the ReportDocument (EROM bridge)
boReportClientDocument = boReportDocument.ReportClientDocument;
//Get the first section in the details section
boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
//Create the field object that we will add to the report and set all of its properties
boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
//Set which field to use for the data to be displayed
boFieldObject.DataSourceName = "{Customer.City}";
boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
boFieldObject.Left = 4 * 1440; //1440 twips per inch
boFieldObject.Width = 3 * 1440;
boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
boFieldObject.FontColor.Font.Name = "Arial";
boFieldObject.FontColor.Font.Size = 10;
boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
//Add the object to the report
boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
// show in reportviewer
crystalReportViewer1.ReportSource = boReportDocument;
private void button1_Click(object sender, EventArgs e)
//Get the first section in the details section
boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
//Create the field object that we will add to the report and set all of its properties
boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
//Set which field to use for the data to be displayed
boFieldObject.DataSourceName = "{Customer.City}";
boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
boFieldObject.Left = 4 * 1440; //1440 twips per inch
boFieldObject.Width = 3 * 1440;
boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
boFieldObject.FontColor.Font.Name = "Arial";
boFieldObject.FontColor.Font.Size = 10;
boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
//Add the object to the report
boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
// show in reportviewer
crystalReportViewer1.ReportSource = boReportDocument; -
Report painter-want to hide period columns dynamically if the period is not closed
Hi All,
I have made report with 12 columns like JAN, FEB till DEC in report painter (GRR1)
Requirement is that if say, currently only period no.4(APR) is closed and we are in period no.5( MAY) or system date is in MAY, then the report should not show the data for the current period no.5(MAY), eventhough data is there. Or else it should show data for JAN to APR (closed periods)
For this I defined 12 different period formula variables in GS11, based on system paramters like
S008 Year (from Local System Date)
S002 Month (from Local System Date)
S003 Day of Month (from Local System Date)
S012 Current Period in Current Year (per CO Fiscal Yea
But the issue is that eventhough the variable is defined as formula variables, still the default values are given by system and default value only getting passed to the report and thus data is displayed for the unclosed period.
But SAP help says that formula variables are without default values unlike the value type variable.
Any help in this will be highly appreciated.Hi All,
I have cracked it and got the solution with redefining the formula variables.
Details
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
No.of days in each Month
31
28
31
30
31
30
31
31
30
31
30
day number in year
31
59
90
120
151
181
212
243
273
304
334
result available after 15 days
47
75
106
136
167
197
228
259
289
320
350
Formula variable definition for 11 months in current year
ZTPFR01
ZTPFR02
ZTPFR03
ZTPFR04
ZTPFR05
ZTPFR06
ZTPFR07
ZTPFR08
ZTPFR09
ZTPFR10
ZTPFR11
IF '#S005' <47
IF '#S005' <75
IF '#S005' <106
IF '#S005' <136
IF '#S005' <167
IF '#S005' <197
IF '#S005' <228
IF '#S005' <259
IF '#S005' <289
IF '#S005' <320
IF '#S005' <350
THEN 1
THEN 2
THEN 3
THEN 4
THEN 5
THEN 6
THEN 7
THEN 8
THEN 9
THEN 10
THEN 11
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0 -
How to add column dynamically based on user input in oracle?
**how to add column dynamically based on user input in oracle?**
I am generating monthly report based on from_date to to_date below is my requirement sample table
EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE | 01-OCT-12 | 02-OCT-12 | 03-OCT-12
100001.............John...........02-OCT-12...............6
100002.............chris...........01-OCT-12...............4
Based on user input, that is, if user need the report from 01-OCT-12 TO 03-OCT-12, i need to add that dates as column in my table, like 01-OCT-12 | 02-OCT-12 | 03-OCT-12....
below is my code
create or replace
procedure MONTHLY_LVE_NEW_REPORT_demo
L_BUSINESS_UNIT IN SSHRMS_LEAVE_REQUEST_TRN.BUSINESS_UNIT%TYPE,
--L_LEAVE_TYPE_CODE IN SSHRMS_LEAVE_REQUEST_TRN.LEAVE_TYPE_CODE%TYPE,
L_DEPARTMENT_CODE IN VARCHAR2,
--L_MONTH IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
L_FROM_DATE IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
L_TO_DATE in SSHRMS_LEAVE_REQUEST_TRN.LVE_TO_DATE%type,
MONTHRPT_CURSOR OUT SYS_REFCURSOR
AS
O_MONTHRPT_CURSOR_RPT clob;
v_return_msg clob;
BEGIN
IF (L_BUSINESS_UNIT IS NOT NULL
AND L_FROM_DATE IS NOT NULL
and L_TO_DATE is not null
-- AND L_DEPARTMENT_CODE IS NOT NULL
THEN
OPEN MONTHRPT_CURSOR FOR
select EMPLOYEE_CODE, EMPLOYEE_NAME AS NAME, DEPARTMENT_CODE AS DEPARTMENT,DEPARTMENT_DESC, CREATED_DATE,
NVL(WM_CONCAT(CL_RANGE),'') as CL_TAKEN_DATE,
case when NVL(SUM(CL2),0)<0 then 0 else (NVL(SUM(CL2),0)) end as CL_BALANCE,
from
SELECT DISTINCT a.employee_code,
a.EMPLOYEE_FIRST_NAME || ' ' || a.EMPLOYEE_LAST_NAME as EMPLOYEE_NAME,
a.DEPARTMENT_CODE,
a.DEPARTMENT_DESC,
B.LEAVE_TYPE_CODE,
B.LVE_UNITS_APPLIED,
B.CREATED_DATE as CREATED_DATE,
DECODE(b.leave_type_code,'CL',SSHRMS_LVE_BUSINESSDAY(L_BUSINESS_UNIT,to_char(b.lve_from_date,'mm/dd/yyyy'), to_char(b.lve_to_date,'mm/dd/yyyy'))) CL_RANGE,
DECODE(B.LEAVE_TYPE_CODE,'CL',B.LVE_UNITS_APPLIED)CL1,
b.status
from SSHRMS_EMPLOYEE_DATA a
join
SSHRMS_LEAVE_BALANCE C
on a.EMPLOYEE_CODE = C.EMPLOYEE_CODE
and C.STATUS = 'Y'
left join
SSHRMS_LEAVE_REQUEST_TRN B
on
B.EMPLOYEE_CODE=C.EMPLOYEE_CODE
and c.EMPLOYEE_CODE = b.EMPLOYEE_CODE
and B.LEAVE_TYPE_CODE = C.LEAVE_TYPE_CODE
and B.STATUS in ('A','P','C')
and (B.LVE_FROM_DATE >= TO_DATE(L_FROM_DATE, 'DD/MON/RRRR')
and B.LVE_TO_DATE <= TO_DATE(L_TO_DATE, 'DD/MON/RRRR'))
join
SSHRMS_LEAVE_REQUEST_TRN D
on a.EMPLOYEE_CODE = D.EMPLOYEE_CODE
and D.LEAVE_TYPE_CODE in ('CL')
AND D.LEAVE_TYPE_CODE IS NOT NULL
group by EMPLOYEE_CODE, EMPLOYEE_NAME, DEPARTMENT_CODE, DEPARTMENT_DESC, CREATED_DATE
else
v_return_msg:='Field should not be empty';
end if;
END;
my code actual output
EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE
100001....................John............02-OCT-12.................6
100001....................chris...........01-OCT-12.................4
how to add column dynamically based on from_date to to_date?
Thanks and Regards,
Chris Jerome.You cannot add columns dynamically. But you can define a maximum number of numbers and then hide unused columns in your form useing SET_ITEM_PROPERTY(..,VISIBLE, PROPERTY_FALSE);
-
How to schedule the webi report based on data changes in the report data
Hello,
I want to schedule a webi report based on data change in a column in the report.
The scenario is something like below:
1. If a data of a particular column changes from 2 to 3 than I would like to schedule this report and sent it to users mail box.
I know how to apply alerts or schedule a report or data tracking for capturing changes in the report but I dont know how to schedule the report only for data changes.
Anybody done this before.
Thanks
GauravHi,
May be these links can help you:
http://devnet.magicsoftware.com/en/library?book=en/iBOLT/&page=SAP_R_3_Master_Data_Distribution_Defining_Change_Pointers.htm
SEM-BCS: Load from data stream schedule
Attribute Change Run -
Displaying the Row and Column number in the report
I am trying to show row and column number in the report (not just web preview). I am using Hyperion Reports Version 7.2.5.168
use a formula column/row. use RANK function in that. (e.g. Rank([A], asc) will sort the rows based on column A values in ascending order)
you can use this rank in your heading.
But frankly this is not so easy. You have to do it in a very intelligent way, so that rank gives you column number/row number any how.
Have a try and let see if you find a appropriate solution.
Regards,
Rahul -
How to call a package from the Report in Oracle Application Express
How to call a package from the Report in Oracle Application Express
Hello,
What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
Or do you want to execute a procedure when something happens on the page, like clicking a button?
Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-) -
How to suppress the report based on outer dimension in nested report
Hi Experts,
We have a report with nesting of two dimensions in rows. They are Program dimension and Account Dimension.
We need to supress the report based on the program dimension members. i.e whenever there are no values against all the accounts for a particular program that particular program should get supressed.
In the screenshot attached I am looking to supress the rows 37,38 and 39 as the data against this program is empty.
However I dont want to supress the rows 31 and 33 as there is a capital data against this program in row number 32. So we have to supress the rows based on absence of data at program level.
We are using SP14 on BPC 10.
I remember that such functionality could be acheived in BPC 7.5 by flagging the required dimension to have suppress in Expansion Range. So I guess, similar functionality would be there in BPC 10 as well.
I have evaluated the option of VBA macro to hide the required rows, but was wondering if we can achieve the same using EPM functionality as we used to do in BPC7.5.
Thanks in advance for your suggestions!!
Regards,
ShivaHi Shiva,
First you have to check the option Keep Blocks:
This option will show the whole block even if only one line contain some not zero/empty cells in the row.
Second, when you select option Filter on All Columns/Rows you have to select OR as operator between columns:
In this case the test for >0 (or for <0) will be applied to each column and the result will be OR'ed with other columns. True will be even if one column contains not zero and not empty cell.
You logic to check individual column require to hardcode the members - not good!
Vadim
P.S. If you select AND for Filter on All Columns/Rows - then only lines with all cells with non zero / non empty will be shown as in your example! -
How to integrate conditional colors to the Report
<!--Hi all APEX gurus,
I would like to ask if you could help me with the problem how to integrate conditional COLORS to the Report. I need to display Severity field in RED but how to include the multiple "quotation marks" and 'apostrophs' to the query below?
I need to replace i."Severity" field in the query below with the DECODE like this:
DECODE (i."Severity", 1, '<span style="color:red;font-weight:bold">' || i."Severity" || '</span>', i."Severity") "Severity"
Original Query:
DECLARE
q varchar2(4000);
BEGIN
q := ' select ';
q := q || ' i."ID" "ID", ';
q := q || ' i."Task_ID" "Task ID", ';
q := q || ' i."Severity" "Severity", ';
q := q || ' i."Priority" "Priority", ';
q := q || ' i."Task" "Task Name", ';
q := q || ' p."Project_Name" "Project" ';
q := q || ' from ';
q := q || ' "IDEAS" i, ';
q := q || ' "PROJECT_LOOKUP" p ';
q := q || ' where ';
q := q || ' p."Project_ID" = i."Project_ID" ';
if :P1_Show != 'ALL' then
q := q || ' and i."Project_ID" = :P1_Show';
end if;
RETURN q;
END;
I have tried many variants but still have problem with the " " and ' ' included in the DECODE command together with the q-variable.
Thank you for any tips and
Happy New Year!
AB
-->Hi user487406,
What about a select like this:
select i.id,
i.task_id,
case i.severity
when 1 then '<span style="color:red;font-weight:bold">' || i.severity || '</span>'
else
to_char(i.severity)
end severity,
i.priority,
i.task,
p.project_name
from ideas i,
project_lookup p
where p.project_id = i.project_id;
And PL/SQL like this:
q :=
' select i.id, ' ||
' i.task_id, ' ||
' case i.severity ' ||
' when 1 then ''<span style="color:red;font-weight:bold">'' || i.severity || ''</span>'' ' ||
' else ' ||
' to_char(i.severity) ' ||
' end severity, ' ||
' i.priority, ' ||
' i.task, ' ||
' p.project_name ' ||
' from ideas i, ' ||
' project_lookup p ' ||
' where p.project_id = i.project_id; '; Regards Pete -
Hi,
I would like to give a prompt in SSSRS report so that report is generated based on the prompt (no default
value is taken)and the generated report should have different parameters as filters (except the initial prompt parameter).
Thanks & Regards,
GaneshThank Santosh for responding.
I was looking for similar thing but I want to navigate to another report when view report is clicked on the report and pass my parameters from initial report.
Can we keep any action on view report button on the report??
Thanks & Regards,
Ganesh -
How to make reports based on Data block work on web?
I am using form 6i and oracle 9ias
I have successfully call the common reports from the form on the web using run_report_object, then web.show_documnet(..);
But when it come to the reports based on the data block from the form, it doesn't work. it always fetch all the records from the table which the data block is based
Anyone can tell me how to make that work?
thanksI have successfully do this when I am running forms and >reports in localhostTell me how did you achieve this?
Did you have both Reports and Forms running under same oracle home?
and off course was it a clinet server architecture?
What version for Form and Reports did you use?
Which executables did you use and what was your call from forms? When you call from Forms, which Reports executable use to run the report?
The data integration can only be achive if both the product were running under same Oracle home and were in client server architecture. I do not think data integration is possible in web architecture.
Thanks
Rohit (Orcale Reports Team) -
Display the report between two dates
Hi,
I'm new to this application.i have created two date fields item.i want to display the report between two date fields.please help me.how to do?.
By,
Prem.Prem,
See this example:
http://htmldb.oracle.com/pls/otn/f?p=31517:99
Denes Kubicek
http://deneskubicek.blogspot.com/
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------
Maybe you are looking for
-
Exchange Global Address List search not showing name or email
I have an iPhone and iPad connected to a Microsoft Exchange server at work. When I search the GAL for a person in the company, the results are shown as the Company only (data coming from the 'Company' field on the Exchange server) instead of the cont
-
Podcasts not showing up from search
Hi, I logged in today on iTunes and noticed that our podcasts are no longer showing up on iTunes Store. I tried doing a search on 'fowler' and 'fowlerinc' and couldn't find anything. I checked the XML file and didn't find any errors, so I was wonderi
-
Error Handler API: No proper Initialization of the global message list
Hi All, I'm trying the following: 1. Call of Web Service EGO_ITEM_PUB.PROCESS_ITEM for an already existing item 'CS_Test_Item_01' with parameters: +<soapenv:Body>+ +<proc:InputParameters>+ +<proc:P_API_VERSION>1.0</proc:P_API_VERSION>+ +<proc:P_INIT_
-
Only some of the music in my library will synch to my ipad
I have ripped a number of CD's to my PC music library, but when I try to synch this music to my Ipad only some of the music appears. Ideas?
-
iPhone music will not respond to Play button after being paused. The same music is on my iPad and MacBook Pro without problems. Any suggestions about cause and solution.