Group by groups

I have a bunch of data I need to transform and "group by groups." Let me explain by an example:
SQL> create table orig_data as
  2  select distinct job, deptno
  3  from scott.emp e
  4  /
Table created.
SQL> select job
  2       , deptno
  3    from orig_data
  4   order by
  5         job
  6       , deptno
  7  /
JOB           DEPTNO
ANALYST           20
CLERK             10
CLERK             20
CLERK             30
MANAGER           10
MANAGER           20
MANAGER           30
PRESIDENT         10
SALESMAN          30
9 rows selected.The real-world data is about 5 million rows.
First I group by job (I use xmlagg here because I am on version 11.1 and therefore no listagg ;-) ):
SQL> select od.job
  2       , rtrim(xmlagg(xmlelement(d,od.deptno,',').extract('//text()') order by od.deptno),',') deptnos
  3    from orig_data od
  4   group by od.job
  5  /
JOB       DEPTNOS
ANALYST   20
CLERK     10,20,30
MANAGER   10,20,30
PRESIDENT 10
SALESMAN  30I notice here that both job CLERK and MANAGER has the same set of deptnos.
So if I group by deptnos I can get this result:
SQL> select s2.deptnos
  2       , rtrim(xmlagg(xmlelement(j,s2.job,',').extract('//text()') order by s2.job),',') jobs
  3    from (
  4     select od.job
  5          , rtrim(xmlagg(xmlelement(d,od.deptno,',').extract('//text()') order by od.deptno),',') deptnos
  6       from orig_data od
  7      group by od.job
  8         ) s2
  9   group by s2.deptnos
10  /
DEPTNOS                        JOBS
10                             PRESIDENT
10,20,30                       CLERK,MANAGER
20                             ANALYST
30                             SALESMANMy requirement is to identify all such unique groups of deptnos in my orig_data table, give each such group a surrogate key in a parent table, and then populate two child tables with the deptnos of each group and the jobs that have that group of deptnos:
SQL> create table groups (
  2     groupkey number primary key
  3  )
  4  /
Table created.
SQL> create table groups_depts (
  2     groupkey number references groups (groupkey)
  3   , deptno number(2)
  4  )
  5  /
Table created.
SQL> create table groups_jobs (
  2     groupkey number references groups (groupkey)
  3   , job varchar2(9)
  4  )
  5  /
Table created.For the surrogate groupkey I can just use a rownumber on my group by deptnos query:
SQL> select row_number() over (order by s2.deptnos) groupkey
  2       , s2.deptnos
  3       , rtrim(xmlagg(xmlelement(j,s2.job,',').extract('//text()') order by s2.job),',') jobs
  4    from (
  5     select od.job
  6          , rtrim(xmlagg(xmlelement(d,od.deptno,',').extract('//text()') order by od.deptno),',') deptnos
  7       from orig_data od
  8      group by od.job
  9         ) s2
10   group by s2.deptnos
11  /
  GROUPKEY DEPTNOS                        JOBS
         1 10                             PRESIDENT
         2 10,20,30                       CLERK,MANAGER
         3 20                             ANALYST
         4 30                             SALESMANThat query I can use for a (slow) insert into my three tables in this simple manner:
SQL> begin
  2     for g in (
  3        select row_number() over (order by s2.deptnos) groupkey
  4             , s2.deptnos
  5             , rtrim(xmlagg(xmlelement(j,s2.job,',').extract('//text()') order by s2.job),',') jobs
  6          from (
  7           select od.job
  8                , rtrim(xmlagg(xmlelement(d,od.deptno,',').extract('//text()') order by od.deptno),',') deptnos
  9             from orig_data od
10            group by od.job
11               ) s2
12         group by s2.deptnos
13     ) loop
14        insert into groups values (g.groupkey);
15
16        insert into groups_depts
17           select g.groupkey
18                , to_number(regexp_substr(str, '[^,]+', 1, level)) deptno
19             from (
20                    select rownum id
21                         , g.deptnos str
22                      from dual
23                  )
24           connect by instr(str, ',', 1, level-1) > 0
25                  and id = prior id
26                  and prior dbms_random.value is not null;
27
28        insert into groups_jobs
29           select g.groupkey
30                , regexp_substr(str, '[^,]+', 1, level) job
31             from (
32                    select rownum id
33                         , g.jobs str
34                      from dual
35                  )
36           connect by instr(str, ',', 1, level-1) > 0
37                  and id = prior id
38                  and prior dbms_random.value is not null;
39
40     end loop;
41  end;
42  /
PL/SQL procedure successfully completed.The tables now contain this data:
SQL> select *
  2    from groups
  3   order by groupkey
  4  /
  GROUPKEY
         1
         2
         3
         4
SQL> select *
  2    from groups_depts
  3   order by groupkey, deptno
  4  /
  GROUPKEY     DEPTNO
         1         10
         2         10
         2         20
         2         30
         3         20
         4         30
6 rows selected.
SQL> select *
  2    from groups_jobs
  3   order by groupkey, job
  4  /
  GROUPKEY JOB
         1 PRESIDENT
         2 CLERK
         2 MANAGER
         3 ANALYST
         4 SALESMANI can now from these data get the same result as before (just to test I have created the desired data):
SQL> select g.groupkey
  2       , d.deptnos
  3       , j.jobs
  4    from groups g
  5    join (
  6           select groupkey
  7                , rtrim(xmlagg(xmlelement(d,deptno,',').extract('//text()') order by deptno),',') deptnos
  8             from groups_depts
  9            group by groupkey
10         ) d
11         on d.groupkey = g.groupkey
12    join (
13           select groupkey
14                , rtrim(xmlagg(xmlelement(j,job,',').extract('//text()') order by job),',') jobs
15             from groups_jobs
16            group by groupkey
17         ) j
18         on j.groupkey = g.groupkey
19  /
  GROUPKEY DEPTNOS                        JOBS
         1 10                             PRESIDENT
         2 10,20,30                       CLERK,MANAGER
         3 20                             ANALYST
         4 30                             SALESMANSo far so good. This all works pretty much as desired - except for a couple of things:
The very simple loop insert code will be slow. OK, it is a one-time conversion job (in theory, but very few times at least) so that could probably be acceptable (except for my professional pride ;-) .)
But worse is, that I have groups where the string aggregation won't work - the string would have to be about varchar2(10000) which won't work in SQL in the group by :-( .
So I have tried an attempt using collections. First a collection of deptnos:
SQL> create type deptno_tab_type as table of number(2)
  2  /
Type created.
SQL> select od.job
  2       , cast(collect(od.deptno order by od.deptno) as deptno_tab_type) deptnos
  3    from orig_data od
  4   group by od.job
  5  /
JOB       DEPTNOS
ANALYST   DEPTNO_TAB_TYPE(20)
CLERK     DEPTNO_TAB_TYPE(10, 20, 30)
MANAGER   DEPTNO_TAB_TYPE(10, 20, 30)
PRESIDENT DEPTNO_TAB_TYPE(10)
SALESMAN  DEPTNO_TAB_TYPE(30)All very good - no problems here. But then a collection of jobs:
SQL> create type job_tab_type as table of varchar2(9)
  2  /
Type created.
SQL> select s2.deptnos
  2       , cast(collect(s2.job order by s2.job) as job_tab_type) jobs
  3    from (
  4     select od.job
  5          , cast(collect(od.deptno order by od.deptno) as deptno_tab_type) deptnos
  6       from orig_data od
  7      group by od.job
  8         ) s2
  9   group by s2.deptnos
10  /
group by s2.deptnos
ERROR at line 9:
ORA-00932: inkonsistente datatyper: forventede -, fik XAL_SUPERVISOR.DEPTNO_TAB_TYPENow it fails - I cannot group by a collection datatype...
I am not asking anyone to write my code, but I know there are sharper brains out there on the forums ;-) .
Would anyone have an idea of something I might try that will allow me to create these "groups of groups" even for larger groups than string aggregation techniques can handle?
Thanks for any help, hints or tips ;-)

The "group-by-collection" issue can be solved by creating a container object on which we define an ORDER method :
SQL> create type deptno_container as object (
  2    nt deptno_tab_type
  3  , order member function match (o deptno_container) return integer
  4  );
  5  /
Type created
SQL> create or replace type body deptno_container as
  2    order member function match (o deptno_container) return integer is
  3    begin
  4      return case when nt = o.nt then 0 else 1 end;
  5    end;
  6  end;
  7  /
Type body created
Then a multitable INSERT can do the job, after unnesting the collections :
SQL> insert all
  2    when rn0 = 1 then into groups (groupkey) values (gid)
  3    when rn1 = 1 then into groups_jobs (groupkey, job) values(gid, job)
  4    when rn2 = 1 then into groups_depts (groupkey, deptno) values(gid, deptno)
  5  with all_groups as (
  6    select s2.deptnos
  7         , cast(collect(s2.job order by s2.job) as job_tab_type) jobs
  8         , row_number() over(order by null) gid
  9    from (
10      select od.job
11           , deptno_container(
12               cast(collect(od.deptno order by od.deptno) as deptno_tab_type)
13             ) deptnos
14      from orig_data od
15      group by od.job
16    ) s2
17    group by s2.deptnos
18  )
19  select gid
20       , value(j) job
21       , value(d) deptno
22       , row_number() over(partition by gid order by null) rn0
23       , row_number() over(partition by gid, value(j) order by null) rn1
24       , row_number() over(partition by gid, value(d) order by null) rn2
25  from all_groups t
26     , table(t.jobs) j
27     , table(t.deptnos.nt) d
28  ;
15 rows inserted
SQL> select * from groups;
  GROUPKEY
         1
         2
         3
         4
SQL> select * from groups_jobs;
  GROUPKEY JOB
         1 SALESMAN
         2 PRESIDENT
         3 CLERK
         3 MANAGER
         4 ANALYST
SQL> select * from groups_depts;
  GROUPKEY DEPTNO
         1     30
         2     10
         3     10
         3     30
         3     20
         4     20
6 rows selected
Works great on the sample data but how this approach scales on a much (much) larger dataset is another story :)

Similar Messages

  • Cannot send email from an iPhone to a Outlook group.

    Hi,
    My question is simple and I'd like an exactly same answer : Can iPhone users send emails from their iPhone's to one or more groups created in Outlook?
    This is my situation: our organization is using iPhone to provide email, calendar, contact, task etc. to some of their employees. We are using Airwatch MDM Agent on user's iPhone because we have an Airwatch server in place. I have an user and she has an iPhone 5 and she has created some groups in Outlook but these groups are not reflected in her Contacts in the iPhone. I have update her phone with the latest update, although I was almost sure that this was not the issue, then I've found some interesting posts on internet saying that this was a known problem for the users with the previous iOS but I thought this might has been corrected with the iOS, apparently not.
    Also I've tried ''the trick'' that is posted on several forums with the iCloud but neither so it's working. I am looking for a straight answer, if this works or not on iPhone's?
    Thanks,
    Sebastian.

    There indeed ARE apps in the app store that will do what you want.  Just search and find the one that best fits your needs.

  • Grouping and Decimal characters in rtf templates.

    Hi guys and girls,
    I’m really struggling with a problem here regarding the decimal characters for the prices in my output.
    I'm using XML Publisher 5.6.3.
    My goal is to control the grouping and decimal character from my template.
    The numbers in the XML data file can either be 10.000,00 or 10,000.00. The format is handled by the users nls_numeric_characters profile option.
    The output of the template shall be based on the locale and not the data generated by Oracle Reports. For example: Reports to US customers shall show the numbers in the following format 10,000.00. Reports to our European customers shall show the numbers in this format 10.000,00.
    How can I achieve this in my templates? Can it be achieved at all?
    Thank you in advance.
    Kenneth Kristoffersen
    Edited by: Kenneth_ on May 19, 2009 1:30 AM

    Hi,
    Thank you for your reply.
    The problem is that the report is generating the output based on the users profile option nls_numeric_characters.
    I have tried to override the users profile option in the before report trigger without any luck. I can alter selects so the query gets the numbers in the right format but then I would have to go through all queryes and reports which seem a bit wrong? Especially for the standard Oracle reports.
    BR Kenneth

  • How do I use Panorama / Tab Groups with the keyboard?

    Yes I know that CTRL-SHIFT-E opens the panorama window, and then I can use the mouse to organize my tabs into groups.
    But how do I do this with the keyboard?
    I've [http://lifehacker.com/#!5719596/switch-between-tab-groups-in-firefox-with-a-keyboard-shortcut read] [http://ubuntuforums.org/showthread.php?t=1705714 that] Ctrl-`should move me through tab groups. That doesn't work for me on my Danish keyboard. (Where the ' and ` chars are weird. But is how they are on a valid standard Danish keyboard) I've tried changing the keyboard to USA and then moving through tab groups works fine.
    In short: Pretend I don't have a mouse. How do I use Panorama / Tab Groups?

    Sorry. These are both known bugs:
    [https://bugzilla.mozilla.org/show_bug.cgi?id=587010 Bug 587010] - Add keyboard UI for manipulated groups and tabs in Tab Candy
    and
    [https://bugzilla.mozilla.org/show_bug.cgi?id=626594 Bug 626594] - shortcut for switching tab groups is badly accessible on many non-US keyboard layouts

  • Issue With Page Break When Sorting is also applied on group

    Hi
    I am facing an issue with Page break only when I have sorting applied on the grouping that I have in the template.
    The following is the sample XML
    <ROWSET>
    <ROW>
    <GRE>org1</GRE>
    <ORGANIZATION>Accounts</ORGANIZATION>
    <FULL_NAME>test1,</FULL_NAME>
    <ELEMENT_NAME>TEST BONUS</ELEMENT_NAME>
    <CLASSIFICATION>Supplemental Earnings</CLASSIFICATION>
    <RUN_VALUE>250</RUN_VALUE>
    <MONTH_VALUE>500</MONTH_VALUE>
    <QUARTER_VALUE>500</QUARTER_VALUE>
    <YEAR_VALUE>500</YEAR_VALUE>
    </ROW>
    <ROW>
    <GRE>org1</GRE>
    <ORGANIZATION>Finance</ORGANIZATION>
    <FULL_NAME>test2</FULL_NAME>
    <ELEMENT_NAME>VOLUNTARY AD AND D</ELEMENT_NAME>
    <CLASSIFICATION>Voluntary Deductions</CLASSIFICATION>
    <RUN_VALUE>5.19</RUN_VALUE>
    <MONTH_VALUE>10.38</MONTH_VALUE>
    <QUARTER_VALUE>10.38</QUARTER_VALUE>
    <YEAR_VALUE>10.38</YEAR_VALUE>
    </ROW>
    <ROW>
    <GRE>org1</GRE>
    <ORGANIZATION>Finance</ORGANIZATION>
    <FULL_NAME>test3</FULL_NAME>
    <ELEMENT_NAME>HMO MEDICAL</ELEMENT_NAME>
    <CLASSIFICATION>Pre-Tax Deductions</CLASSIFICATION>
    <RUN_VALUE>19.67</RUN_VALUE>
    <MONTH_VALUE>39.34</MONTH_VALUE>
    <QUARTER_VALUE>39.34</QUARTER_VALUE>
    <YEAR_VALUE>39.34</YEAR_VALUE>
    </ROW>
    <ROW>
    <GRE>org1</GRE>
    <ORGANIZATION>Finance</ORGANIZATION>
    <FULL_NAME>test4</FULL_NAME>
    <ELEMENT_NAME>PENSION NR DC</ELEMENT_NAME>
    <CLASSIFICATION>Pre-Tax Deductions</CLASSIFICATION>
    <RUN_VALUE>0</RUN_VALUE>
    <MONTH_VALUE>360</MONTH_VALUE>
    <QUARTER_VALUE>360</QUARTER_VALUE>
    <YEAR_VALUE>360</YEAR_VALUE>
    </ROW>
    </ROWSET>
    In the template I group the data based on CLASSIFICATION and then sort on the same column CLASSIFICATION. I have a page-break applied for every group.
    When I generate the PDF, I am not getting the page-breaks for every group. Instead some of them are displayed in the same page.
    But when I remove the sorting that I had in the template on the column CLASSIFICATION, I am getting the output in the desired way but not in a sorted order.
    kumar

    Hi All,
    I am using MS-WORD 2007 and BI Publisher desktop 10.1.3.3.3.
    When I use split-by-page-break, splitting is performed for every line .. but not for group of lines.
    Can anybody throw some light on this?
    FYI...
    I am using this code:
    ?if: position() mod 6= 0?
    ?split-by-page-break:?
    ?end if?
    (Of course with in tags)
    in G_LINES loop.
    Can anybody help me out :-(
    --Saritha                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Repeating a group element on each page of a report.

    I have a report where I need to repeat a group element on each page. The element is from the first group in the data. It is in the center group. Currently, the values from this group only print when the group changes. Everything I try does not work. Does anyone have any ideas. I am attaching a sample of the data. Along with the rtf document. I am using the BI Publisher plug in in Word to create the template.
    Data
    <?xml version="1.0" encoding="UTF-8"?>
    <POLLEDTICKETRPT>
    <USERCD>klockhar</USERCD><POLLDATE>03/24/2009</POLLDATE>
    <LIST_CENTER>
    <CENTER>
    <CENTER_CD>0039</CENTER_CD>
    <CENTER_NAME>CROSS PLAINS QUARRY</CENTER_NAME>
    <LIST_TRANSDATE>
    <TRANSDATE>
    <TRANS_DATE>03/11/2009</TRANS_DATE>
    <LIST_CUSTOMER>
    <CUSTOMER>
    <CUSTOMER_NBR>33221477</CUSTOMER_NBR>
    <CUST_NAME>TDOT DISTRICT 32-GALLATIN</CUST_NAME>
    <LIST_JOB>
    <JOB>
    <JOB_CUST>33221477</JOB_CUST>
    <JOB_CUST_NAME>TDOT DISTRICT 32-GALLATIN</JOB_CUST_NAME>
    <RGI_JOB_NBR>2008</RGI_JOB_NBR>
    <QUOTE_ID>0</QUOTE_ID>
    <LIST_COSTCODE>
    <COSTCODE>
    <COSTCODING/>
    <COST_CNTR/>
    <COST_ACCT/>
    <PROJECT_NBR/>
    <PROJECT_TASK/>
    <LIST_TICKET>
    <TICKET>
    <TICKET_NBR>5000021</TICKET_NBR>
    <ORIGIN_CD>TSCC</ORIGIN_CD>
    <REFERENCE_NBR>254510</REFERENCE_NBR>
    <VOID_IND>N</VOID_IND>
    <STATE_CD>TN</STATE_CD>
    <MEASURE_SYSTEM>S</MEASURE_SYSTEM>
    <LOCATION>THANK YOU</LOCATION>
    <PO_NBR>POS-254510-C</PO_NBR>
    <TAX_CODE>4</TAX_CODE>
    <PRODUCT_CD>000003</PRODUCT_CD>
    <HAUL_ZONE_CD/>
    <INVENTORY_STATUS>PR</INVENTORY_STATUS>
    <HAULER_NBR/>
    <RGI_TRANSPORT_CD>FU96</RGI_TRANSPORT_CD>
    <HAUL_RATE> .00</HAUL_RATE>
    <MAT_RATE> 8.50</MAT_RATE>
    <NET_TONS> -7.96</NET_TONS>
    <MAT_SALES_AMT> -67.66</MAT_SALES_AMT>
    <HAUL_AMT>0</HAUL_AMT>
    <TAX_AMT>0</TAX_AMT>
    <SEV_TAX_AMT>0</SEV_TAX_AMT>
    <SEV_TAX_IND>N</SEV_TAX_IND>
    <VALID_NET_TONS> -7.96</VALID_NET_TONS>
    <VALID_SALES_AMT> -67.66</VALID_SALES_AMT>
    <VALID_HAUL_AMT> .00</VALID_HAUL_AMT>
    <VALID_TAX_AMT> .00</VALID_TAX_AMT>
    <VALID_SEV_TAX_AMT> .00</VALID_SEV_TAX_AMT>
    <CASH_TONS> .00</CASH_TONS>
    <CASH_SALES_AMT> .00</CASH_SALES_AMT>
    <CASH_TAX_AMT> .00</CASH_TAX_AMT>
    <CASH_SEVTAX_AMT> .00</CASH_SEVTAX_AMT>
    <CASH_HAUL_AMT> .00</CASH_HAUL_AMT>
    <TRADE_TONS> -7.96</TRADE_TONS>
    <TRADE_SALES_AMT> -67.66</TRADE_SALES_AMT>
    <TRADE_TAX_AMT> .00</TRADE_TAX_AMT>
    <TRADE_SEVTAX_AMT> .00</TRADE_SEVTAX_AMT>
    <TRADE_HAUL_AMT> .00</TRADE_HAUL_AMT>
    <INTRA_TONS> .00</INTRA_TONS>
    <INTRA_SALES_AMT> .00</INTRA_SALES_AMT>
    <INTRA_TAX_AMT> .00</INTRA_TAX_AMT>
    <INTRA_SEVTAX_AMT> .00</INTRA_SEVTAX_AMT>
    <INTRA_HAUL_AMT> .00</INTRA_HAUL_AMT>
    <INTER_TONS> .00</INTER_TONS>
    <INTER_SALES_AMT> .00</INTER_SALES_AMT>
    <INTER_TAX_AMT> .00</INTER_TAX_AMT>
    <INTER_SEVTAX_AMT> .00</INTER_SEVTAX_AMT>
    <INTER_HAUL_AMT> .00</INTER_HAUL_AMT>
    <CASH_PR_TONS> .00</CASH_PR_TONS>
    <CASH_NP_TONS> .00</CASH_NP_TONS>
    <CASH_MI_TONS> .00</CASH_MI_TONS>
    <TRADE_PR_TONS> -7.96</TRADE_PR_TONS>
    <TRADE_NP_TONS> .00</TRADE_NP_TONS>
    <TRADE_MI_TONS> .00</TRADE_MI_TONS>
    <INTER_PR_TONS> .00</INTER_PR_TONS>
    <INTER_NP_TONS> .00</INTER_NP_TONS>
    <INTER_MI_TONS> .00</INTER_MI_TONS>
    <INTRA_PR_TONS> .00</INTRA_PR_TONS>
    <INTRA_NP_TONS> .00</INTRA_NP_TONS>
    <INTRA_MI_TONS> .00</INTRA_MI_TONS>
    </TICKET>
    </LIST_TICKET>
    </COSTCODE>
    </LIST_COSTCODE>
    </JOB>
    </LIST_JOB>
    </CUSTOMER>
    </LIST_CUSTOMER>
    </TRANSDATE>
    RTF Template
    DISPLAY CENTER
    S M
    FOR EACH CENTER
    SET CENTER
    CENTER: CENTER_CD CENTER_NAME
    FOR EACH TRANSDATE
    TRANSACTION DATE: TRANS_DATE
    FOR EACH CUSTOMER
    FOR EACH JOB
    Customer: JOB_CUST JOB_CUST_NAME
    Job: RGI_JOB_NBR Quote Id: QUOTE_ID
    FCC
    group COSTCODE by COSTCODING
    Cost Center: COST_CNTR Cost Acct: COST_ACCT Project: PROJECT_NBR Task: PROJECT_TASK
    Ticket Nbr     ORGCD     OrigTck     V     ST     Location     Po Nbr     Tax Cd     Prod Code     ZN     Hauler      Truck     Haul Rate     UnitPrice     Tons     SalesAmount
    F TCK#M     CODE     OTCK#     V     ST     LOCATION     PO_NBR      TC     PROD     HZ     HAULER     TRUCK     0.00     0.00     0.00 *      0.00 E

    Post Author: Guy
    CA Forum: General
    Hi,
    You should add a first level of grouping in your subreport on a fake formula field with a constant value.  Put your header and footer information in this group header and footer.  In the group option make sure to check the "repeat group header on each page option".
    This group will act as a page header + footer within your subreport.
    good luck!
    Guy

  • Sum of LineCount Including Groups and Detail Data On Each Page Used To Generate New Page If TotalPageLineCount 28

    Post Author: tadj188#
    CA Forum: Formula
    Needed: Sum of LineCount Including Groups and Detail Data On Each Page Used To Generate New Page If TotalPageLineCount > 28
    Background:
    1) Report SQL is created with unions to have detail lines continue on a page, until it reaches page footer or report footer, rather than using  subreports.    A subreport report is now essentially a group1a, group1b, etc. (containing column headers and other data within the the report    with their respective detail lines).  I had multiple subreports and each subreport became one union.
    Created and tested, already:
    1) I have calculated @TotalLineForEachOfTheSameGroup, now I need to sum of the individual same group totals to get the total line count on a page.
    Issue:
    1) I need this to create break on a certain line before, it dribbles in to a pre-printed area.
    Other Ideas Appreciated:
    1) Groups/detail lines break inconveniently(dribble) into the pre-printed area, looking for alternatives for above situation.
    Thank you.
    Tadj

    export all image of each page try like this
    var myDoc = app.activeDocument;
    var myFolder = myDoc.filePath;
    var myImage = myDoc.allGraphics;
    for (var i=0; myImage.length>i; i++){
        app.select(myImage[i]);
        var MyImageNmae  = myImage[i].itemLink.name;
        app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.high;
        app.jpegExportPreferences.exportResolution = 300;
           app.selection[0].exportFile(ExportFormat.JPG, File(myFolder+"/"+MyImageNmae+".JPEG"), false);
        alert(myImage[i].itemLink.name)

  • How do you add an iTunes Gift Card so that all purchases of any members of a Family Sharing Group can use the credit?

    How can all family members of a Family Sharing Group use a gift card that has been been applied to the iTunes master account? I added a gift card to our master iTunes account for my grandson, and even though he's a family sharing group member, none of the purchases I have approved from his requests have used the gift card credit. A search of the iTunes support site failed to turn up anything that even remotely addresses this topic. It would seem reasonable to assume that any purchase made by any family member should be able to use the gift card credit since all purchases go through the master account, but this does not appear to be the case.

    Regarding your statement about the gift card balance being used if redeemed to the organizers account - http://www.apple.com/feedback.
    Regarding redeeming the gift card to the child's account, it is the same as redeeming to yours.  You have to be signed in to the iTunes store using the child's apple ID, then redeem the gift card there.  If you already redeemed the card on your ID, you won't be able to redeem it again.
    Redeem and use iTunes Gift Cards and content codes - Apple Support

  • How can I move contact from one group to another?

    HOW CAN I MOVE A CONTACT FROM ONE GROUP TO ANOTHER GROUP?

    You usually make ​​contact groups via a computer (Mac or PC). If you use a mac and sync. via iCloud, you can go into Contacs.app and organize your contacts as you wish. Then (if) you sync with iCloud the groups you've changed or created will be displayed on your iPhone and (or) iPad.
    Hope this helped you.

  • I have photos I want to group together in one album, but can't do this because some may have the same number. How can I combine them all into one album?

    I have photos I want to group together in one album, but can't do this because some may have the same number. How can I combine them all into one album? I was trying to move several albums onto a USB drive and it stated all other files exist at this location.  They are pictures taken at different times and have the same number I guess.

    In iPhoto albums may contain photos with the same file name - iPhoto handles that just fine
    If you are exporting them to move somewhere else use the sequential file name feature of export to give each file a unique name
    LN

  • How do I use Page Grouping to make my form/subforms flow across multiple pages?

    I have every text box set to flow, but one page is not flowing into the next. For one thing, it stops entirely. For another, the content is interfering with the Master Page. I read than Page Grouping can alleviate this issue, but I have no clue how to enact it. Any ideas would be appreciated.
    Thanks so much!

    Please check the subform which is the container of all these text boxes. Please see this : https://groups.google.com/forum/?fromgroups=#!topic/livecycle/yq8FauqHD3w
    Thanks,
    Wasil

  • How To Restrict Number Of Rows For Multiple Group In Report Output

    Hi ,
    I have a requirement to restrict number of rows in report output.I have three different group , if i use same no of rows to restrict then output is as expected but if i want Deduction group should have 7 rows , earning should have 5 rows and Tax group have 3 rows in report output then XML tag is not working.
    Below is the XML tag i am using -
    First i have declare the variable to restrict the rows -
    <xsl:variable name="lpp" select="number(7)"/>
    <xsl:variable name="lpp1" select="number(5)"/>
    <xsl:variable name="lpp2" select="number(3)"/>
    For Each -
    <?for-each:PAYSLIP?>
    <xsl:variable xdofo:ctx="incontext" name="DedLines" select=".//AC_DEDUCTIONS"/>
    <xsl:variable xdofo:ctx="incontext" name="EarLines" select=".//AC_EARNINGS[ELEMENT_CLASSIFICATION!='Taxable Benefits']"/>
    <xsl:variable xdofo:ctx="incontext" name="EarTaxLines" select=".//AC_EARNINGS[ELEMENT_CLASSIFICATION='Taxable Benefits']>
    <?for-each:$DedLines?><?if:(position()-1) mod $lpp=0?> <xsl:variable name="start" xdofo:ctx="incontext" select="position()"/>
    <?if:(position()-1) mod $lpp1=0?><xsl:variable name="start1" xdofo:ctx="incontext" select="position()"/
    <?if:(position()-1) mod $lpp2=0?><xsl:variable name="start2" xdofo:ctx="incontext" select="position()"/>
    Report output is tabular form (one page has two column - Earning and Deduction ) . Tax group comes below earning group.
    Deduction Group -
    <?for-each-group:$DedLines;./REPORTING_NAME?><?if:position()>=$start and position()<$start+$lpp?>
    <?REPORTING_NAME?>
    <?end if?><?end for-each-group?>
    Earning Group -
    <?for-each-group:$EarLines;./REPORTING_NAME?><?if:position()>=$start1 and position()<$start1+$lpp1?>
    <?REPORTING_NAME?>
    <?end if?><?end for-each-group?>
    Tax Group -
    <?for-each-group:$EarTaxLines;./REPORTING_NAME?><?if:position()>=$start2 and position()<$start2+$lpp2?>
    <?REPORTING_NAME?>
    <?end if?><?end for-each-group?>
    Please let me know in case additional detail is require.
    Thanks in Advance.
    Thanks,
    Harsh
    Edited by: Harsh.rkg on Jan 14, 2013 9:43 PM

    variable lpp2 is declare to restrict EarTaxLines -
    <xsl:variable name="lpp2" select="number(2)"/>
    This will help to restrict the no of rows on one page , if we have more then two tax benefits line then layout will roll over to continuation page.
    As part of report output my expectation is if i restrict Earning , Deduction and Tax benefits to same no of line for example - variable lpp ,lpp1 and lpp2 have same value "number(2)" , we can see the layout is continue on next page (restrict every group can have max two lines) .This is the reason we have 4 header grid , deduction and Tax Benefit lines are rolled over to continuation page .But if we restrict different value for each variable then continuation page layout is missing .
    When we tried for <xsl:variable name="lpp2" select="number(3)"/> value continuation page layout is not getting generate for both employee number .

  • HT201269 How do I add another contact / recipient to an SMS. Easy in Android, but I can't see how on my 5s.  Have to create a group on my Macbook Pro (OS 9.1), but it's not getting synced via usb. I'd prefer not to use cloud.

    How do I add a contact / recipient to an SMS on iPhone 5s?  It's easy on Android, but I've not sussed it on the iPhone - can't create a group etc.  Tried to create a group on Mac, but it either doesn't exist or won't sync to the phone with usb, nor will other contact details created on Mac.  I'd rather not use the cloud.  I'm sure contacts used to sync to my old iPod touch in Snow Leopard.
    Is it not more logical to have the phone as the main source of this sort of data?  We're more likely to update on a device we carry all the time surely?
    Please advise. Thank you

    Hey Cornish wrinkly,
    It sounds like you want to create a group message. You can read about group messaging on the iPhone here:
    iOS: Understanding group messaging
    http://support.apple.com/kb/HT5760
    Welcome to Apple Support Communities!
    Regards,
    Delgadoh

  • How do I add multiple contacts to a group?

    How do I add multiple contacts to a group on my Ipad?

    See if this thread helps.
    https://discussions.apple.com/thread/4114588
    Matt

  • How do I move multiple tabs into a tab group in one go?

    It would be nice if the Tab Group feature would support standard Windows conventions for multi-selection, so I wouldn't have to move tabs between groups only one at a time. If I want to move 20, say, it quickly becomes tedious. Shift-select and CTRL-select should be made available if this feature is to be truly useful.
    Please feel free to enlighten me if I've missed some method by which this is currently doable. However, I would still suggest to add the above feature, so it conforms to Windows standards. :-)

    As far as I can tell, it doesn't look like this is part of Tab Groups yet. It would definitely make a great feature though! :)

  • How do I move contacts from one group to another?

    I entered several contacts in address book.  How do I control which group they are assigned to at the time of entry?  The ones I added showed up in my office contacts in Outlook instead of in Hotmail/iCloud.
    Is it possible to move them from one group to another once entered?

    Do the contacts that are not in iCloud belong to an external account such as Gmail, Yahoo or an Exchange account?  Or, do they belong to On My iPhone?

Maybe you are looking for