How to generate report with dynamic variable number of columns?

How to generate report with dynamic variable number of columns?
I need to generate a report with varying column names (state names) as follows:
SELECT AK, AL, AR,... FROM States ;
I get these column names from the result of another query.
In order to clarify my question, Please consider following table:
CREATE TABLE TIME_PERIODS (
PERIOD     VARCHAR2 (50) PRIMARY KEY
CREATE TABLE STATE_INCOME (
     NAME     VARCHAR2 (2),
     PERIOD     VARCHAR2 (50)     REFERENCES TIME_PERIODS (PERIOD) ,
     INCOME     NUMBER (12, 2)
I like to generate a report as follows:
AK CA DE FL ...
PERIOD1 1222.23 2423.20 232.33 345.21
PERIOD2
PERIOD3
Total 433242.23 56744.34 8872.21 2324.23 ...
The TIME_PERIODS.Period and State.Name could change dynamically.
So I can't specify the state name in Select query like
SELECT AK, AL, AR,... FROM
What is the best way to generate this report?

SQL> -- test tables and test data:
SQL> CREATE TABLE states
  2    (state VARCHAR2 (2))
  3  /
Table created.
SQL> INSERT INTO states
  2  VALUES ('AK')
  3  /
1 row created.
SQL> INSERT INTO states
  2  VALUES ('AL')
  3  /
1 row created.
SQL> INSERT INTO states
  2  VALUES ('AR')
  3  /
1 row created.
SQL> INSERT INTO states
  2  VALUES ('CA')
  3  /
1 row created.
SQL> INSERT INTO states
  2  VALUES ('DE')
  3  /
1 row created.
SQL> INSERT INTO states
  2  VALUES ('FL')
  3  /
1 row created.
SQL> CREATE TABLE TIME_PERIODS
  2    (PERIOD VARCHAR2 (50) PRIMARY KEY)
  3  /
Table created.
SQL> INSERT INTO time_periods
  2  VALUES ('PERIOD1')
  3  /
1 row created.
SQL> INSERT INTO time_periods
  2  VALUES ('PERIOD2')
  3  /
1 row created.
SQL> INSERT INTO time_periods
  2  VALUES ('PERIOD3')
  3  /
1 row created.
SQL> INSERT INTO time_periods
  2  VALUES ('PERIOD4')
  3  /
1 row created.
SQL> CREATE TABLE STATE_INCOME
  2    (NAME   VARCHAR2 (2),
  3       PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD),
  4       INCOME NUMBER (12, 2))
  5  /
Table created.
SQL> INSERT INTO state_income
  2  VALUES ('AK', 'PERIOD1', 1222.23)
  3  /
1 row created.
SQL> INSERT INTO state_income
  2  VALUES ('CA', 'PERIOD1', 2423.20)
  3  /
1 row created.
SQL> INSERT INTO state_income
  2  VALUES ('DE', 'PERIOD1', 232.33)
  3  /
1 row created.
SQL> INSERT INTO state_income
  2  VALUES ('FL', 'PERIOD1', 345.21)
  3  /
1 row created.
SQL> -- the basic query:
SQL> SELECT   SUBSTR (time_periods.period, 1, 10) period,
  2             SUM (DECODE (name, 'AK', income)) "AK",
  3             SUM (DECODE (name, 'CA', income)) "CA",
  4             SUM (DECODE (name, 'DE', income)) "DE",
  5             SUM (DECODE (name, 'FL', income)) "FL"
  6  FROM     state_income, time_periods
  7  WHERE    time_periods.period = state_income.period (+)
  8  AND      time_periods.period IN ('PERIOD1','PERIOD2','PERIOD3')
  9  GROUP BY ROLLUP (time_periods.period)
10  /
PERIOD             AK         CA         DE         FL                                             
PERIOD1       1222.23     2423.2     232.33     345.21                                             
PERIOD2                                                                                            
PERIOD3                                                                                            
              1222.23     2423.2     232.33     345.21                                             
SQL> -- package that dynamically executes the query
SQL> -- given variable numbers and values
SQL> -- of states and periods:
SQL> CREATE OR REPLACE PACKAGE package_name
  2  AS
  3    TYPE cursor_type IS REF CURSOR;
  4    PROCEDURE procedure_name
  5        (p_periods   IN     VARCHAR2,
  6         p_states    IN     VARCHAR2,
  7         cursor_name IN OUT cursor_type);
  8  END package_name;
  9  /
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY package_name
  2  AS
  3    PROCEDURE procedure_name
  4        (p_periods   IN     VARCHAR2,
  5         p_states    IN     VARCHAR2,
  6         cursor_name IN OUT cursor_type)
  7    IS
  8        v_periods          VARCHAR2 (1000);
  9        v_sql               VARCHAR2 (4000);
10        v_states          VARCHAR2 (1000) := p_states;
11    BEGIN
12        v_periods := REPLACE (p_periods, ',', ''',''');
13        v_sql := 'SELECT SUBSTR(time_periods.period,1,10) period';
14        WHILE LENGTH (v_states) > 1
15        LOOP
16          v_sql := v_sql
17          || ',SUM(DECODE(name,'''
18          || SUBSTR (v_states,1,2) || ''',income)) "' || SUBSTR (v_states,1,2)
19          || '"';
20          v_states := LTRIM (SUBSTR (v_states, 3), ',');
21        END LOOP;
22        v_sql := v_sql
23        || 'FROM     state_income, time_periods
24            WHERE    time_periods.period = state_income.period (+)
25            AND      time_periods.period IN (''' || v_periods || ''')
26            GROUP BY ROLLUP (time_periods.period)';
27        OPEN cursor_name FOR v_sql;
28    END procedure_name;
29  END package_name;
30  /
Package body created.
SQL> -- sample executions from SQL:
SQL> VARIABLE g_ref REFCURSOR
SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2,PERIOD3','AK,CA,DE,FL', :g_ref)
PL/SQL procedure successfully completed.
SQL> PRINT g_ref
PERIOD             AK         CA         DE         FL                                             
PERIOD1       1222.23     2423.2     232.33     345.21                                             
PERIOD2                                                                                            
PERIOD3                                                                                            
              1222.23     2423.2     232.33     345.21                                             
SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2','AK,AL,AR', :g_ref)
PL/SQL procedure successfully completed.
SQL> PRINT g_ref
PERIOD             AK         AL         AR                                                        
PERIOD1       1222.23                                                                              
PERIOD2                                                                                            
              1222.23                                                                              
SQL> -- sample execution from PL/SQL block
SQL> -- using parameters derived from processing
SQL> -- cursors containing results of other queries:
SQL> DECLARE
  2    CURSOR c_period
  3    IS
  4    SELECT period
  5    FROM   time_periods;
  6    v_periods   VARCHAR2 (1000);
  7    v_delimiter VARCHAR2 (1) := NULL;
  8    CURSOR c_states
  9    IS
10    SELECT state
11    FROM   states;
12    v_states    VARCHAR2 (1000);
13  BEGIN
14    FOR r_period IN c_period
15    LOOP
16        v_periods := v_periods || v_delimiter || r_period.period;
17        v_delimiter := ',';
18    END LOOP;
19    v_delimiter := NULL;
20    FOR r_states IN c_states
21    LOOP
22        v_states := v_states || v_delimiter || r_states.state;
23        v_delimiter := ',';
24    END LOOP;
25    package_name.procedure_name (v_periods, v_states, :g_ref);
26  END;
27  /
PL/SQL procedure successfully completed.
SQL> PRINT g_ref
PERIOD             AK         AL         AR         CA         DE         FL                       
PERIOD1       1222.23                           2423.2     232.33     345.21                       
PERIOD2                                                                                            
PERIOD3                                                                                            
PERIOD4                                                                                            
              1222.23                           2423.2     232.33     345.21                       

Similar Messages

  • How to clone data with in Table with dynamic 'n' number of columns

    Hi All,
    I've a table with syntax,
    create table Temp (id number primary key, name varchar2(10), partner varchar2(10), info varchar2(20));
    And with data like
    insert itno temp values (sequence.nextval, 'test', 'p1', 'info for p1');
    insert into temp values (sequence.nextval, 'test', 'p2', 'info for p2');
    And now, i need to clone the data in TEMP table of name 'test' for new name 'test1' and here is my script,
    insert into Temp  select sequence.nextval id, 'test1' name, partner, info from TEMP where name='test1';
    this query executed successfully and able to insert records.
    The PROBLEM is,
    if some new columns added in TEMP table, need to update this query.
    How to clone the data with in the table for *'n' number of columns and*
    some columns with dynamic data and remaining columns as source data.
    Thanks & Regards
    PavanPinnu.
    Edited by: pavankumargupta on Apr 30, 2009 10:37 AM

    Hi,
    Thanks for the quick reply.
    My Scenario, is we have a Game Details table. When ever some Game get cloned, we need to add new records in to that Table for the new Game.
    As, the id will be primary key, this should populate from a Sequence (in our system, we used this) and Game Name will be new Game Name. And data for other columns should be same as Parent Game.
    when ever business needs changes, there will be some addition of new columns in Table.
    And with the existing query,
    insert into Temp (id, name, partner, info) select sequence.nextval id, 'test1' name, partner, info from TEMP where name='test'_
    will successfully add new rows but new added columns will have empty data.
    so, is there any way to do this, i mean, some columns with sequence values and other columns with existing values.
    One way, we can do is, get ResultSet MetaData (i'm using Java), and parse the columns. prepare a query in required format.
    I'm looking for alternative ways in query format in SQL.
    Thanks & Regards
    PavanPinnu.
    Edited by: pavankumargupta on Apr 30, 2009 11:05 AM
    Edited by: pavankumargupta on Apr 30, 2009 11:05 AM

  • Creating a table with a variable number of columns

    Hi,
    I am working on a form and I want to allow the user to add tables to the form. If I give them a base table (for instance, a table with two rows and columns) is there any way to allow the user to add columns to the table. I can add new instances of rows, but I need the number of columns to be variable as well.
    I am working in Livecycle Designer ES2

    Hi,
    check this article.
    http://forms.stefcameron.com/2006/10/28/scripting-table-columns/
    Hope this helps.

  • How to create report with dynamic columns with static row labels

    Hi All,
    I am creating one report as per attached format. I have labels on the right side of the report
    and data in 3 columns. The data is taken dynamically from the command query.
    It gets data from 3 different result sets/command queries.
    I tried creating the report horizontally instead of vertically, but the logo image I am not able to rotate in 270degrees.
    Can anybody tell me how to create the report...??

    Hi Abhilash,
    Thanks for the quick reply.
    Actually the problem is with the image, as I am not able to rotate 270 degree. Crystal report cannot support the rotation of image.
    i have another problem, I have to create a report in which
    Lables are fixed on the left side of report and 3 columns per portrait page. Those columns are
    dynamically created and shown in the report.
    The format is like the above. Can you please help me in doing this report, as I tried it doing
    with CrossTab. I am really stuck to this report.

  • Display table with variable number of columns

    Hello Forum,
    I'm trying to build an export view of User Management Engine data. I would like to output a table with one row for every user with yes / no fields indicating membership in each of the available groups. Because the number of available groups might change in the future, I can't hardcode the column names for the groups.
    That is, I call a webservice to compute a table, and I get back a table with a variable number of columns.
    When I try to insert the webservice into my VC model, it complains:
    "Port 'Response' was omitted because it includes nested tables, which are not presently supported by Visual Composer"
    You might be interested to know that the business method of my webservice (for testing purposes) looks as follows:
    public String[][] getVariableSizeArray() {
            String[][] ret = new String[10][];
            for (int i = 1; i <= 10; i++) {
                    ret<i> = new String[10];
                    for (int j = 1; j <= 10; j++) {
                            ret<i>[j] = Integer.toString(i * j);
            return ret;
    Any help is appreciated, and points will be awarded for helpful answers,
    Sincerely,
    Florian
    Message was edited by:
            Florian Something

    Hi Florian,
    dynamic data structures are not supported. You can do this with a workaround. If you know the maximum count of your columns then you can add them to the table and hide/unhide them dynamicly via a formula in the hidden condition. Of course in your WS you als need a fix structure of your columns.
    This is not the best solution, I know so far, but it works. This is just one limit of VC.
    Best Regards,
    Marcel

  • How to create user editable Crystal Report with dynamic dataset

    What I would like to achieve:
    A program loads a report in runtime updates list of database fields (possibly includes sample data), open report in "Crystal Reports 2011" (or 2008) where user customizes report and saves it. Later on the program loads the report, fills actualized data and displays it in .net report viewer.
    What I do:
    CrReport = New CrystalDecisions.CrystalReports.Engine.ReportDocument
    CrReport.Load(TemplateFilename)
    Dim Results As DataTable
    DataTable is filled from a database
    CrReport.SetDataSource(mResults)
    CrReport.SaveAs(NewReportPath, True)
    The NewReportPath is opened in the default program.
    What are the problems
    The report is open in preview mode (not in design).
    When the field is added to the report the designer asks for XML datasource on preview.

    The short answer is that it is not possible. I broke the question to other two: How to save a report that it opens without preview? and How to create user editable Crystal Report with dynamic dataset, where it is possible to find details. Key answer is Re: How to create an editable previewable report?

  • How to schedule a report with dynamic parameters

    We need to schedule a Webi report with dynamic parameters then email the different result to different email groups.  Is it possible to do this in scheduler? Please advise. Thanks.

    there are 2 schedulers
    1st  CMS
    the reports which does not have any input parameters, only then t can be scheduled in CMS
    2nd in Infoview
    if report has input parameters and if you want to schedule it, then you may need to schedule the report from Infoview
    To have a email notification
    configure the SMTP server in report JOB Server
    Thanks,
    Ganesh

  • Procedure with variable number of columns

    Hi, I have a procedure that looks like this:
    PROCEDURE PROC(p_cursor OUT sys_refcursor)
    And in the procedure, I build up QUERY dynamically and the number of columns varies at runtime.
    At the end I do
    OPEN p_cursor for QUERY
    Then to call this, I'm doing
    call PROC(?)
    My question is, how would I go about running the query from this procedure, then adding rows or modifying the existing results, then returning the modified data?
    What I want to do is add a new row based on some condition, so I still need to return a variable number of columns, but I need to modify the results before I return them.
    Is there any way of doing this? I need to do some calculations on the columns (the variable columns), create a new row, insert into result set, and return this new result set.

    A sys_refcursor is ideally suited to pass back to a front end gui like .NET or Java which can then use that cursor to retrieve the data.
    In PL/SQL there is no point in using a sys_refcursor unless you know, at design/compile time what the returned columns are going to be.
    If the resultant columns are dynamic, then you have no choice but to use the DBMS_SQL package, where you can parse and execute any SQL statement you like and then use the DBMS_SQL package to describe what the resultant columns are and how many there are. From that you can reference the columns by position rather than by name.
    e.g.
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2) IS
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_rowcount  NUMBER := 0;
    BEGIN
      -- create a cursor
      c := DBMS_SQL.OPEN_CURSOR;
      -- parse the SQL statement into the cursor
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      -- execute the cursor
      d := DBMS_SQL.EXECUTE(c);
      -- Describe the columns returned by the SQL statement
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      -- Bind local return variables to the various columns based on their types
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000); -- Varchar2
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);      -- Number
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);     -- Date
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);  -- Any other type return as varchar2
        END CASE;
      END LOOP;
      -- Display what columns are being returned...
      DBMS_OUTPUT.PUT_LINE('-- Columns --');
      FOR j in 1..col_cnt
      LOOP
        DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' - '||case rec_tab(j).col_type when 1 then 'VARCHAR2'
                                                                                  when 2 then 'NUMBER'
                                                                                  when 12 then 'DATE'
                                                         else 'Other' end);
      END LOOP;
      DBMS_OUTPUT.PUT_LINE('-------------');
      -- This part outputs the DATA
      LOOP
        -- Fetch a row of data through the cursor
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        -- Exit when no more rows
        EXIT WHEN v_ret = 0;
        v_rowcount := v_rowcount + 1;
        DBMS_OUTPUT.PUT_LINE('Row: '||v_rowcount);
        DBMS_OUTPUT.PUT_LINE('--------------');
        -- Fetch the value of each column from the row
        FOR j in 1..col_cnt
        LOOP
          -- Fetch each column into the correct data type based on the description of the column
          CASE rec_tab(j).col_type
            WHEN 1  THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                         DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||v_v_val);
            WHEN 2  THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                         DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||v_n_val);
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                         DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'));
          ELSE
            DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
            DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||v_v_val);
          END CASE;
        END LOOP;
        DBMS_OUTPUT.PUT_LINE('--------------');
      END LOOP;
      -- Close the cursor now we have finished with it
      DBMS_SQL.CLOSE_CURSOR(c);
    END;
    SQL> exec run_query('select empno, ename, deptno, sal from emp where deptno = 10');
    -- Columns --
    EMPNO - NUMBER
    ENAME - VARCHAR2
    DEPTNO - NUMBER
    SAL - NUMBER
    Row: 1
    EMPNO : 7782
    ENAME : CLARK
    DEPTNO : 10
    SAL : 2450
    Row: 2
    EMPNO : 7839
    ENAME : KING
    DEPTNO : 10
    SAL : 5000
    Row: 3
    EMPNO : 7934
    ENAME : MILLER
    DEPTNO : 10
    SAL : 1300
    PL/SQL procedure successfully completed.
    SQL> exec run_query('select * from emp where deptno = 10');
    -- Columns --
    EMPNO - NUMBER
    ENAME - VARCHAR2
    JOB - VARCHAR2
    MGR - NUMBER
    HIREDATE - DATE
    SAL - NUMBER
    COMM - NUMBER
    DEPTNO - NUMBER
    Row: 1
    EMPNO : 7782
    ENAME : CLARK
    JOB : MANAGER
    MGR : 7839
    HIREDATE : 09/06/1981 00:00:00
    SAL : 2450
    COMM :
    DEPTNO : 10
    Row: 2
    EMPNO : 7839
    ENAME : KING
    JOB : PRESIDENT
    MGR :
    HIREDATE : 17/11/1981 00:00:00
    SAL : 5000
    COMM :
    DEPTNO : 10
    Row: 3
    EMPNO : 7934
    ENAME : MILLER
    JOB : CLERK
    MGR : 7782
    HIREDATE : 23/01/1982 00:00:00
    SAL : 1300
    COMM :
    DEPTNO : 10
    PL/SQL procedure successfully completed.
    SQL> exec run_query('select * from dept where deptno = 10');
    -- Columns --
    DEPTNO - NUMBER
    DNAME - VARCHAR2
    LOC - VARCHAR2
    Row: 1
    DEPTNO : 10
    DNAME : ACCOUNTING
    LOC : NEW YORK
    PL/SQL procedure successfully completed.
    SQL>In 11g, you can create a sys_refcursor and then the DBMS_SQL package allows you to convert that refcursor into a DBMS_SQL cursor so that you can get the description of the results and do the same. This isn't available prior to 11g though.
    However_ before any of that, you should really ask yourself if there is a real need to dynamically be creating queries. There is rarely any real need to do that and if you're finding it's common in your application then this is often a sign of poor design or poorly defined business requirements (leaving the technical side to try and be "flexible" and hence leading to unmaintainable code etc.).

  • How to generate reports of registered IP handsets and their corresponding extension on call manager 4.2.3

    Hi
    how to generate reports of registered IP handsets and their corresponding extension on call manager 4.2.3
    I checked the route plan report and the generate report function on the BAT.. however it doesnt has the feature to generate only the registered IP phone with its coresponding extension
    Thanks
    Kind regards
    Rachel

    Call manager provides the called party with the extension or directory number of the calling party on a display. You can use the Calling Line ID Presentation field in the Gateway Configuration window to control whether the CLID displays for all outgoing calls on the gateway.Refer URL
    http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_administration_guide_chapter09186a008070e48b.html#wp1051056

  • How to generate a random session variable in php

    i want to generate a random session variable and insert the variable in a mysql record to use later to validate an account set up.
    person fills out form to create account and submits; inserts form information in mysql record.
    i want the random variable to be inserted from a hidden field and the page sends an email with a link to click on to compare the variable to validate the user.
    Not sure how to generate a random session variable and get that to the hidden field value to be inserted with the other form information.
    thanks for your help,
    Jim Balthrop

    To insert the key I would personally do something like...
    $key = md5($username . $password . $salt);
    Insert that into your MySQL database, then send them a email with it, my next code shows how to activate it.
    This is to activate the account.
    <?php
    $key;
    $errors = array();
    if(isset($_GET['key']){
         $key = $_GET['key'];
         $sql = 'SELECT * FROM users WHERE key = \'' . $key '\' LIMIT 1';
         $result = mysql_query($sql) or die(mysql_error());
         if(mysql_num_rows($result)){
              $sql2 = 'UPDATE users SET active = 1 WHERE key = \'' . $key '\' LIMIT 1';
              $result2 = mysql_query($sql2) or die(mysql_error());
              if($result2){
                   //successfully activated account
              else{
                   //Something Went Wrong!
         else{
              $errors[] = 'Invaild Key, Please try again!';
    else{
         $errors[] = 'Invaild Key, Please try again!';
    ?>

  • Deadlock with thread issues while generating reports with Crystal Report XI

    We are facing deadlock with thread issues while generating report with Crystal Report XI
    Version Number is 11.0 and the database used is Oracle
    In the log file on line number 74350  by 2008/12/16 13:35:54 there is a dead lock with Thread: u20184u2019 is waiting to acquire lock for 'com.crystaldecisions.reports.queryengine.av@15214b9' which is held by the Thread: '0'.
    And  a dead lock with Thread: u20180u2019 is waiting to acquire lock for 'com.crystaldecisions.reports.queryengine.av@15214b9' which is held by the Thread: '4'.
    Exactly after 10 minutes we can see the thread 4 and 0 are declared as STUCK by 2008/12/16  13:45:54 .
    Is this an existing issue with Crystal Report?
    Is there some solution for this problem?
    THE LOG FILE INFORMATION IS GIVEN BELOW
    [deadlocked thread] [ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)':
    Thread '[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'' is waiting to acquire lock 'com.crystaldecisions.reports.queryengine.av@15214b9' that is held by thread '[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)''
    Stack trace:
         com.crystaldecisions.reports.queryengine.av.V(Unknown Source)
         com.crystaldecisions.reports.queryengine.av.do(Unknown Source)
         com.crystaldecisions.reports.queryengine.as.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.c(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.cy.b(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.cy.long(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.a(Unknown Source)
         com.crystaldecisions.reports.common.ab.a(Unknown Source)
         com.crystaldecisions.reports.common.ab.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
         com.crystaldecisions.reports.reportengineinterface.a.a(Unknown Source)
         com.crystaldecisions.reports.reportengineinterface.a.a.b.a(Unknown Source)
         com.crystaldecisions.reports.sdk.ReportClientDocument.open(Unknown Source)
         com.sysarris.aris.crystalreports.RepServlet.generateReport(RepServlet.java:65)
         com.sysarris.aris.crystalreports.RepServlet.doPost(RepServlet.java:40)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    [deadlocked thread] [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)':
    Thread '[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'' is waiting to acquire lock 'com.crystaldecisions.reports.queryengine.av@12e0415' that is held by thread '[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)''
    Stack trace:
         com.crystaldecisions.reports.queryengine.av.V(Unknown Source)
         com.crystaldecisions.reports.queryengine.av.do(Unknown Source)
         com.crystaldecisions.reports.queryengine.as.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.c(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.cy.b(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.cy.long(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.a(Unknown Source)
         com.crystaldecisions.reports.common.ab.a(Unknown Source)
         com.crystaldecisions.reports.common.ab.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
         com.crystaldecisions.reports.reportengineinterface.a.a(Unknown Source)
         com.crystaldecisions.reports.reportengineinterface.a.a.b.a(Unknown Source)
         com.crystaldecisions.reports.sdk.ReportClientDocument.open(Unknown Source)
         com.sysarris.aris.crystalreports.RepServlet.generateReport(RepServlet.java:65)
         com.sysarris.aris.crystalreports.RepServlet.doPost(RepServlet.java:40)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    Can you please suggest any work around for this?

    I'm not referring to Servlet threading issues.
    I'll clarify.
    You have two threads, both entering ReportClientDocument.open(...) method.
    Thread 4 is waiting to acquire 'com.crystaldecisions.reports.queryengine.av@15214b9'
    Thread 0 is waiting to acquire ''com.crystaldecisions.reports.queryengine.av@12e0415'
    So I'm thinking ??? are they the same objects?
    My specific question concerning the ReportClientDocument is that both are calling open - i.e., trying to open a new report.  You wouldn't be trying to open different reports using the same ReportClientDocument - so was wondering if you've cached the RCD and trying to open two different reports at the same time on the same instance via different threads.
    You'd normally tie a ReportClientDocument instance to a HTTP Session, to ensure each user gets their own copy.
    Sincerely,
    Ted Ueda

  • How to generate report for Service sheet - ECC 6.0

    Hi
    Can anyone let me know regarding how to generate reports for  service sheets entered
    regards
    Sanjay

    Hi,
    Get Service Entry Sheet with following T.codes:
    1.MSRV6
    2.ML84
    Regards,
    Biju K

  • How to access variable number of columns using ref cursor !

    Hi,
    I am trying to get variable number of columns using ref cursor.
    Declare
    mySzSql varchar2(2000);
    Type dynSqlRC is Ref cursor;
    current_cur dynSqlRC;
    tbl_rec alt_42_consolidated%Rowtype;
    Begin:
    /* This works */
    mySzSql := 'select *
    from
    Table1
    Where
    rowid = ''AAEWNEABXAAAAkxAAA''';
    /* i want something like this to work, this is not working, giving missing variable name error */
    mySzSql := 'select col1, col2, col3
    from
    Table1
    Where
    rowid = ''AAEWNEABXAAAAkxAAA''';
    open current_cur for mySzSql;
    fetch current_cur into tbl_rec;
    close current_cur;
    End;
    I do have the list of desired columns which I am looking to fetch, so after taking that in the record type, how should i get their values. Is it possible to traverse tbl_rec declared above and if column name matches then I will store the value in the array and finally return this array.
    Can somebody please tell me how to do this.
    Thanks

    It appears that this is a followup to How to loop through columns selected by select clause which is itself a followup to [url="
    How to execute dynamic sql"]this earlier thread.
    Assuming these are intended to be followup questions, can we please stick to a single thread? That makes it a lot easier to understand the situation and follow the conversation. Starting multiple threads makes it harder to follow the conversation.
    Thanks,
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Submit report with dynamic selections

    Hi All,
    I am trying to Submit a report with dynamic selections. I am using the option SUBMIT REPORT WITH FREE SELECTIONS.
    But the dynamic selections are not getting passed.
    Request you to kindly provide some inputs
    My code is
    DATA: trange TYPE rsds_trange,
          trange_line LIKE LINE OF trange,
          trange_frange_t_line LIKE LINE OF trange_line-frange_t,
          trange_frange_t_selopt_t_line LIKE LINE OF trange_frange_t_line-selopt_t,
          texpr TYPE rsds_texpr.
    trange_line-tablename = 'PA0002'.
    *trange_frange_t_line-tablename = 'PA0002'.
    trange_frange_t_line-fieldname = 'GBJHR'.
    trange_frange_t_selopt_t_line-sign   = 'I'.
    trange_frange_t_selopt_t_line-option = 'EQ'.
    trange_frange_t_selopt_t_line-low    = '1987'.
    trange_frange_t_selopt_t_line-high   = '1987'.
    APPEND trange_frange_t_selopt_t_line TO   trange_frange_t_line-selopt_t.
    APPEND trange_frange_t_line TO trange_line-frange_t.
    APPEND trange_line TO trange.
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
      EXPORTING
        field_ranges = trange
      IMPORTING
        expressions  = texpr.
    submit RPCADVQ0
    VIA SELECTION-SCREEN
                    WITH SELECTION-TABLE rspar_tab
                    WITH FREE SELECTIONS it_texpr
                    and returN.
    Kindly provide your inputs
    Regards
    Reshma

    Hi Reshma,
    Use the FM - RS_REFRESH_FROM_DYNAMICAL_SEL before FREE_SELECTIONS_RANGE_2_EX.
      data: trange  type rsds_trange,
              g_repid type sy-repid.
    g_repid = 'RPCADVQ0'.
      call function 'RS_REFRESH_FROM_DYNAMICAL_SEL'
        exporting
          curr_report        = g_repid
          mode_write_or_move = 'M'
        importing
          p_trange           = trange
        exceptions
          not_found          = 1
          wrong_type         = 2
          others             = 3.
      if sy-subrc eq 0.
    " Do the changes to the trange
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
    EXPORTING
    field_ranges = trange
    IMPORTING
    expressions = texpr.
    submit RPCADVQ0
    VIA SELECTION-SCREEN
    WITH SELECTION-TABLE rspar_tab
    WITH FREE SELECTIONS it_texpr
    and returN.
    endif.
    Cheers,
    Kothand

  • IMPORT statement with dynamic variable

    Friends, Need Help!!!!!!!
    Im trying IMPORT variable contents from a cluster table VARI. I can do a IMPORT without issues when I use exact name of the variable but I have issues with dynamic variable selection. Pls see code below.
    loop at objects.
       assign objects-name to <fs>.
       IMPORT <fs> to tmp_var from database vari(va) id st_key.
    endloop.
    I do not get any value to tmp_var.  Need help!
    thanks
    Bhaskar

    Try this.
    loop at objects.
    IMPORT (objects-name) to tmp_var from database vari(va) id st_key.
    endloop.
    Does it work?
    Regards,
    RIch Heilman

Maybe you are looking for

  • Create EJB and call it from ABAP

    Hi all, I have written a stand-alone-Java application, which should be converted into a web application, which has no gui. This application should be triggered by a abap-program. Following questions, do I have to write a servlet and a ejb or is it po

  • Location of IMPORTED Movies in iMovie

    So, I use an elgato game capture to make videos and once edited on the elgato program i have to export the video over to iMovie. However this has not been working lately, but this is an issue on the elgato program. This program offers other export fo

  • T-code query

    Hi Gurus, What particular t-code in creating a report for the following details: 1. Vendor code 2. vendor name 3. PO No. 4. PO Item No. 5. material description 6. material No. 7. Material Grp. 8. PO date 9. PO Qty 10. PO amount 11. Cost center 12. G/

  • CDE File Manager - dtfile

    Ive installed Solaris8 for x86 on a PIII 450MHZ PC. Everything seems to run fine except for the file manager. When the file manager in CDE is used CPU usage goes to 100% the file list doesnt appear and the system is very sluggish. To recover I have t

  • Shift Key and Wireless Keyboard

    I'm trying to highlight several pictures in Photo Booth to send them over to iPhoto. I went to the genius bar and they simply highlighted all of the pics using the shift key and pulled them in. On my computer at home, however, I cannot highlight all