Page caption text won't flow into multiple columns : LR4 book module

Hi,
I'm in process of creating a photobook using LR4's Book Module. Whenever I create a multiple columns page or photo caption, the text won't flow from the 1st column into the suceeding column... does this happen to anybody else. The multiple columns feature however does work for normal text placeholders.

Dorin,
You guess right but that's not very useful to me because sometimes I just want to have a few lines of text at the bottom or at the top of the photo but in 2 or 3 columns for easier reading. I can do that with text placeholders like the one below and the ability to do that with page or photo caption would be desirable too.

Similar Messages

  • How can I separate one column into multiple column?

    How can I separate one column into multiple column?
    This is what I have:
    BUYER_ID ATTRIBUTE_NAME ATTRIBUTE_VALUE
    0001 PHONE_NUMBER 555-555-0001
    0001 EMAIL [email protected]
    0001 CURRENCY USD
    0002 PHONE_NUMBER 555-555-0002
    0002 EMAIL [email protected]
    0002 CURRENCY USD
    0003 PHONE_NUMBER 555-555-0003
    0003 EMAIL [email protected]
    0003 CURRENCY CAD
    This is what I would like to have:
    BUYER_ID PHONE_NUMBER EMAIL CURRENCY
    0001 555-555-0001 [email protected] USD
    0002 555-555-0002 [email protected] USD
    0003 555-555-0003 [email protected] CAD
    Any help would be greatly appreciated.

    This is another solution. Suppose your actual table's name is test(which has the redundant data). create a table like this:
    CREATE TABLE test2 (BUYER_ID number(10),PHONE_NUMBER varchar2(50),EMAIL varchar2(50),CURRENCY varchar2(50));
    then you will type this procedure:
    declare
    phone_number_v varchar2(50);
    EMAIL_v varchar2(50);
    CURRENCY_v varchar2(50);
    cursor my_test is select * from test;
    begin
    for my_test_curs in my_test loop
    select ATTRIBUTE_VALUE INTO phone_number_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='PHONE_NUMBER';
    select ATTRIBUTE_VALUE INTO EMAIL_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='EMAIL';
    select ATTRIBUTE_VALUE INTO CURRENCY_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='CURRENCY';
    INSERT INTO test2
    VALUES (my_test_curs.person_id,phone_number_v,EMAIL_v,CURRENCY_v);
    END LOOP;
    END;
    Then you will create your final table like this:
    create table final_table as select * from test2 where 1=2;
    After that write this code:
    INSERT ALL
    into final_table
    SELECT DISTINCT(BUYER_ID),PHONE_NUMBER,EMAIL,CURRENCY
    FROM TEST2;
    If you have a huge amount of data in your original table this solution may take a long time to do what you need.

  • To display comma separted value into multiple column

    Hi,
    I want to display value into multiple column like below
    data is like this
    col1
    res_menaHome:MenaHome
    res_menaHomeEmp:MenaHome Employee
    res_MDSpecialSer:MD Special Services
    res_Smart:Smart
    now i want to display like
    col1 col2
    res_menaHome MenaHome
    res_menaHomeEmp MenaHome Employee
    res_MDSpecialSer MD Special Services
    res_Smart Smart
    Thanks in advance.

    You mean like this?
    with q as (select 'res_menaHome:MenaHome' myString from dual)
    select substr(myString, 1, instr(myString, ':') - 1) col1,
    substr(myString, instr(myString, ':') + 1) col2
    from q
    COL1,COL2
    res_menaHome,MenaHome

  • Split one column  value and insert into multiple columns

    hi
    am new to plsql .
    i want to split a characters from one column and insert into multiple columns
    i tried used substr function the symbol ',' vary his place dynamically ,so i can't apply substr function.
    for eg:  before split
    col1 :
    col2 :
    col3 :
    col4 :
    colu5: adsdf,fgrty,erfth,oiunth,okujt
    after split
    col1 :adsd
    col2 :fgrty
    col3 :erfth
    col4 :oiunth
    col5 : adsdf,fgrty,erfth,oiunth,okujt
    can anyone help me
    thanks
    Edited by: 800324 on Dec 23, 2010 8:28 AM
    Edited by: 800324 on Dec 23, 2010 8:36 AM

    How about:
    SQL> create table t
      2  (col1 varchar2(30)
      3  ,col2 varchar2(30)
      4  ,col3 varchar2(30)
      5  ,col4 varchar2(30)
      6  ,col5 varchar2(30)
      7  );
    Table created.
    SQL> insert into t (col5) values ('adsdf,fgrty,erfth,oiunth,okujt');
    1 row created.
    SQL> insert into t (col5) values ('x,y');
    1 row created.
    SQL> insert into t (col5) values ('a,b,c,d');
    1 row created.
    SQL> select * from t;
    COL1                           COL2                           COL3                           COL4                           COL5
                                                                                                                                adsdf,fgrty,erfth,oiunth,okujt
                                                                                                                                x,y
                                                                                                                                a,b,c,d
    3 rows selected.
    SQL>
    SQL> merge into t a
      2  using ( with t1 as ( select col5||',' col5
      3                       from   t
      4                     )
      5          select substr(col5, 1, instr(col5, ',', 1, 1)-1) col1
      6          ,      substr(col5, instr(col5, ',', 1, 1)+1, instr(col5, ',', 1, 2)- instr(col5, ',', 1, 1)-1) col2
      7          ,      substr(col5, instr(col5, ',', 1, 2)+1, instr(col5, ',', 1, 3)- instr(col5, ',', 1, 2)-1) col3
      8          ,      substr(col5, instr(col5, ',', 1, 3)+1, instr(col5, ',', 1, 4)- instr(col5, ',', 1, 3)-1) col4
      9          ,      rtrim(col5, ',') col5
    10          from   t1
    11        ) b
    12  on ( a.col5 = b.col5 )
    13  when matched then update set a.col1 = b.col1
    14                             , a.col2 = b.col2
    15                             , a.col3 = b.col3
    16                             , a.col4 = b.col4
    17  when not matched then insert (a.col1) values (null);
    3 rows merged.
    SQL> select * from t;
    COL1                           COL2                           COL3                           COL4                           COL5
    adsdf                          fgrty                          erfth                          oiunth                         adsdf,fgrty,erfth,oiunth,okujt
    x                              y                                                                                            x,y
    a                              b                              c                              d                              a,b,c,d
    3 rows selected.
    SQL> Assuming you're on 9i...

  • Split flat file column data into multiple columns using ssis

    Hi All, I need one help in SSIS.
    I have a source file with column1, I want to split the column1 data into
    multiple columns when there is a semicolon(';') and there is no specific
    length between each semicolon,let say..
    Column1:
    John;Sam;Greg;David
    And at destination we have 4 columns let say D1,D2,D3,D4
    I want to map
    John -> D1
    Sam->D2
    Greg->D3
    David->D4
    Please I need it ASAP
    Thanks in Advance,
    RH
    sql

    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
    Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
    Imports System.IO
    Public Class ScriptMain
    Inherits UserComponent
    Private textReader As StreamReader
    Private exportedAddressFile As String
    Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
    Dim connMgr As IDTSConnectionManager90 = _
    Me.Connections.Connection
    exportedAddressFile = _
    CType(connMgr.AcquireConnection(Nothing), String)
    End Sub
    Public Overrides Sub PreExecute()
    MyBase.PreExecute()
    textReader = New StreamReader(exportedAddressFile)
    End Sub
    Public Overrides Sub CreateNewOutputRows()
    Dim nextLine As String
    Dim columns As String()
    Dim cols As String()
    Dim delimiters As Char()
    delimiters = ",".ToCharArray
    nextLine = textReader.ReadLine
    Do While nextLine IsNot Nothing
    columns = nextLine.Split(delimiters)
    With Output0Buffer
    cols = columns(1).Split(";".ToCharArray)
    .AddRow()
    .ID = Convert.ToInt32(columns(0))
    If cols.GetUpperBound(0) >= 0 Then
    .Col1 = cols(0)
    End If
    If cols.GetUpperBound(0) >= 1 Then
    .Col2 = cols(1)
    End If
    If cols.GetUpperBound(0) >= 2 Then
    .Col3 = cols(2)
    End If
    If cols.GetUpperBound(0) >= 3 Then
    .Col4 = cols(3)
    End If
    End With
    nextLine = textReader.ReadLine
    Loop
    End Sub
    Public Overrides Sub PostExecute()
    MyBase.PostExecute()
    textReader.Close()
    End Sub
    End Class
    Put this code in ur script component. Before that add 5 columns to the script component output and name them as ID, col1, co2..,col4. ID is of data type int. Create a flat file destination and name it as connection and point it to the flat file as the source.
    Im not sure whats the delimiter in ur flat file between the 2 columns. I have use a comma change it accordingly.
    This is the output I get:
    ID Col1
    Col2 Col3
    Col4
    1 john
    Greg David
    Sam
    2 tom
    tony NULL
    NULL
    3 harry
    NULL NULL
    NULL

  • Displaying single value (Record) into multiple columns

    Hi All,
    I want to display the single record into multiple columns. Please let me know How to achieve this..
    Record:
    Lvl Activity Acre
    6 Week 4 (Same value to be displayed into 3 columns.)
    REquired output:
    lvl Activity PH1 PH2 PH3
    6 Week 4 4 4
    Thanks
    Kavi

    user533671 wrote:
    Hi,
    Thanks for immediate reply.
    PH1, PH2, PH3, ... will go more columns based on parameter , what we are passing.An single SQL statement cannot have a dynamic number of columns based on the data itself. The projection (columns returned) have to be known before any data is fetched... and that includes some 'parameter' value.
    {thread:id=2309172}
    You can build a query dynamically, based on a parameter or even on the data, but 99 times out 100 people use dynamic queries where they are not needed.
    Perhaps explain to us what you are really trying to achieve and why, and we could suggest some better way.

  • How to get rid of blank white page next to cover page when converting an indesign file into a pdf flip book

    Hey Everyone,
    I created an catalog using indesign and now I want to convert that into a pdf flip book. I have exported it as a SWF then changing the SWF back into a pdf. It works great however, I keep getting a blank white page next too my cover page, and I really don't want this. I find it very distracting and visually unappealing. Is there any way to get rid of this blank white page? Or any other suggestions on how to create a flip book out of an indesign file.

    It sounds as if you're not checking the pagination properties of the chapter after the problem within the book file.
    The book file settings always trump the component file's settings.
    So this would mean that, if Chapter 3 is set in the book file to start on a Right page, the book enforces this by adding a blank page to Chapter 2.
    You should be able to fix this by selecting all the component chapters in the book, right-clicking and setting all the pagination properties to start on Next Available page, but I don't have 7 on this system so I can't give you the exact key strokes.
    Art

  • Split one row into multiple columns

    Hi,
    Data in one CLOB column in a table storing with delimiter, ##~~##. Ex. ##~~##abc##~~##defgh##~~##ijklm##~~##nopqr (data starts with delimiter). Please help me to split the data into multiple rows like below and it should be in the same order.
    abc
    defgh
    ijklm
    nopqr
    I am using Oracle 11g.
    Thanks.

    Thanks Hoek for your response. Before posting my question in the forum, I tried similar query. It is working with one character as delimiter.
    with test as (select 'ABC,DEF,GHI,JKL,MNO' str from dual )
    select regexp_substr (str, '[^,]+', 1, rownum) split
    from test
    connect by level <= length (regexp_replace (str, '[^,]+')) + 1;
    Above query is giving correct result by fetching 5 rows. I have modified the query like below...
    with test as (select 'ABC,,,DEF,,,GHI,,,JKL,,,MNO' str from dual )
    select regexp_substr (str, '[^,,,]+', 1, rownum) split
    from test
    connect by level <= length (regexp_replace (str, '[^,,,]+')) + 1;
    Above query resulting 13 rows and last 8 rows are nulls. Number of null rows are increasing, if I increase number of characters in delimiter. Could you please tell me how to avoid those null rows.
    Thanks.

  • Groups into Multiple Columns

    Post Author: Donamese
    CA Forum: General
    I am trying to create a report that is split between 3 companies and all states using a distinct count of individuals (as there are duplicates in the data pool).  I would like the report to look like:
    State             Company 1                Company 2                 Company 3
    AL                       0                                 16                           5
    AR                      3                                  9                             4
    AZ                       5                                 0                              7
    Currently I can only get it to list vertical like:
    Company 1
    AL       0
    AR      3
    AZ       5
    Company 2
    AL     16
    etc....
    I am unable to get the formating of multiple columns with the grouping.  Is it possible?  And if

    Post Author: rookie10
    CA Forum: General
    Try inserting a Cross Tab in the Report or page header. Its pretty much like a pivot table.
    Use State as the Row, Company as the Column, Individuals as Summarized field using Distinct Count as the summary type.
    In customized style part of the cross tab you can hide some of the totals and such to get pretty close to the report above - supress subtotals and such.
    Hope this works for you. I was pretty excited when I found this feature in Crystal.
    Rookie10

  • Display rows into multiple columns

    I have a table in the following format:
    id value
    a1 0
    a2 0
    a3 0
    a4 0
    b1 0
    b2 0
    b3 0
    b4 0
    how do I go about displaying it into four columns in the following format:
    id1 value1 id2 value2
    a1 0 b1 0
    a2 0 b2 0
    a3 0 b3 0
    a4 0 b4 0

    Hi,
    789063 wrote:
    I got that error in toad. So now I am testing from command prompt. When you say "command prompt", do you mean SQL*Plus?
    Sorry, I don't know much about Toad. If Toad is returning 0 rows, and the same query is returning 8 rows in SQL*Plus, then I suspect you are not connecting to the same database or the same user. ASre you sure you're running the exact same query in both front ends?
    Here is the data set that I am testing for:
    <pre>
    id1 value
    smple_val_1 0
    smple_val_2 1
    smple_val_3 1
    smple_val_4 2
    smple_other_1 3
    smple_other_2 5
    smple_other_3 8
    smple_other_4 13
    some_other_val1 1
    some_other_val2 0
    some_other_val3 3
    some_other_val4 5
    </pre>
    I am trying to select only 'smple%' in the query, which should display in four columns like:
    <pre>
    id1 val1 id2 val2
    smple_val_1 1 smple_other_1 3
    smple_val_2 0 smple_other_2 5
    smple_val_3 0 smple_other_3 8
    smple_val_4 2 smple_other_4 13
    </pre>Is that really the output you want? Why not
    ID1             VAL1 ID2             VAL2
    smple_val_1        0 smple_other_1      3
    smple_val_2        1 smple_other_2      5
    smple_val_3        1 smple_other_3      8
    smple_val_4        2 smple_other_4     13with the 0's and 1's in the val1 column reversed?
    Here is the ddl I used:
    <pre>
    CREATE TABLE     table_x
    ( id     VARCHAR2 (20)     PRIMARY KEY
    , value     NUMBER
    INSERT INTO table_x (id, value) VALUES ('smple_val_1', 0);
    INSERT INTO table_x (id, value) VALUES ('smple_val_2', 1);
    INSERT INTO table_x (id, value) VALUES ('smple_val_3', 1);
    INSERT INTO table_x (id, value) VALUES ('smple_val_4', 2);
    INSERT INTO table_x (id, value) VALUES ('smple_other_1', 3);
    INSERT INTO table_x (id, value) VALUES ('smple_other_2', 5);
    INSERT INTO table_x (id, value) VALUES ('smple_other_3', 8);
    INSERT INTO table_x (id, value) VALUES ('smple_other_4', 13);
    INSERT INTO table_x (id, value) VALUES ('some_other_val1', 1);
    INSERT INTO table_x (id, value) VALUES ('some_other_val2', 0);
    INSERT INTO table_x (id, value) VALUES ('some_other_val3', 3);
    INSERT INTO table_x (id, value) VALUES ('some_other_val4', 5);
    </pre>Thanks, that's good.
    Where is the explanation of how you get the results you want from that data? There are a lot of different ways to get the same results from the same data, especially from a small set of sample data. I might provide a query that gets the right results for the wrong reasons, and when you run that query on a different set of data, it won't necessarily work. That's exactly what happened before. I guessed at what you wanted, but I guessed wrong. Guessing is not a very efficient or reliable way to solve problems. Don't make people guess: explain what you want.
    In particular, explain how you can tell, buy looking at a row and column in the original table, to which row and which column of the output it corresponds. I'm pretty sure that the id column of the table always corresponds to either the id1 or idl2 column of the output, and that value always corresponds to either val1 or val2. From this latest set of sample data, it looks like all the rows in table_x that start with 'smple_val' will correspond to the id1 and val1 columns, and that all therows that start with 'smple_other_' will correspond to the id2 and val2 columns. It also looks like each row of the output represents a unique value of the last character of table_x.id.
    If I guessed right this time, then what you want is:
    SELECT       MIN (CASE WHEN id LIKE 'smple\_val\_%'   ESCAPE '\' THEN id    END)     AS id1
    ,       MIN (CASE WHEN id LIKE 'smple\_val\_%'   ESCAPE '\' THEN value END)     AS val1
    ,       MIN (CASE WHEN id LIKE 'smple\_other\_%' ESCAPE '\' THEN id    END)     AS id2
    ,       MIN (CASE WHEN id LIKE 'smple\_other\_%' ESCAPE '\' THEN value END)     AS val2
    FROM       table_x
    GROUP BY  SUBSTR (id, -1)
    ORDER BY  SUBSTR (id, -1)
    ;But this is only a guess. I can't guarrantee that this will work on your real data any better than my last guess did. You'll get better answers faster if you provide an explanation, so that poeple don't have to guess so much.

  • How to insert parameter value into multiple columns and rows

    Hi All,
    I have one procedure insert_tab and I am passing
    100~101~102:103~104~105:106~107~108 as a parameter to that procedure. I wanted to insert each numeric value into one column. The output of the table should contain
    Table:
    Col1 Col2 Col3
    100 101 102
    103 104 105
    106 107 108
    Awaiting for your reply..

    That's not more clear for me...
    Anyway, if you really want a procedure for that, try :
    SQL> create table tblstr (col1 number,col2 number,col3 number);
    Table created.
    SQL>
    SQL> create or replace procedure insert_fct (p_string IN varchar2)
      2  as
      3  v_string     varchar2(4000):=p_string||':';
      4  v_substring  varchar2(4000);
      5 
      6  begin
      7      while instr(v_string,':') > 0 loop
      8            v_substring := substr(v_string,1,instr(v_string,':')-1)||'~';
      9            insert into tblstr(col1,col2,col3)
    10            values (substr(v_substring,1,instr(v_substring,'~',1,1)-1),
    11                    substr(v_substring,instr(v_substring,'~',1,1)+1,instr(v_substring,'~',1,2)-instr(v_substring,'~',1,1)-1),
    12                    substr(v_substring,instr(v_substring,'~',1,2)+1,instr(v_substring,'~',1,3)-instr(v_substring,'~',1,2)-1));
    13            v_string:=substr(v_string,instr(v_string,':')+1);
    14      end loop;
    15  end;
    16  /
    Procedure created.
    SQL>
    SQL> show err
    No errors.
    SQL>
    SQL> select * from tblstr;
    no rows selected
    SQL> exec insert_fct('100~101~102:103~104~105:106~107~108')
    PL/SQL procedure successfully completed.
    SQL> select * from tblstr;
          COL1       COL2       COL3
           100        101        102
           103        104        105
           106        107        108
    SQL> exec insert_fct('109~~')
    PL/SQL procedure successfully completed.
    SQL> exec insert_fct('~110~')
    PL/SQL procedure successfully completed.
    SQL> exec insert_fct('~~111')
    PL/SQL procedure successfully completed.
    SQL> select * from tblstr;
          COL1       COL2       COL3
           100        101        102
           103        104        105
           106        107        108
           109
                      110
                                 111
    6 rows selected.
    SQL> Nicolas.

  • To split a column into multiple columns

    Hi,
    I have column and i want to split it into three columns as shown below given inputs and required outputs. I have written this query to get P_1, and p_2 but dont know how to get p_3.
    SELECT ADDRESS,SUBSTR(ADDRESS,1, INSTR(ADDRESS,' ')-1) P_1
         ,SUBSTR(ADDRESS, instr(address,' ',-1)+1) P_2
         FROM TT
    Input:
    ADDRESS     
    1 AVENUE OF THE AMERICAS     
    2 NORTH CAROLINE STREET EAST     
    236 TURPENTINE ROAD COOPER CREEK     
    REQUIRED OUTPUT
    P_1     P_2     P_3     
    1     AMERICAS     AVENUE OF THE
    2     EAST     NORTH CAROLINE STREET
    236     CREEK     TURPENTINE ROAD COOPER
    Thanks in advance

    If you're on 10g or 11g you can do something like this ...
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 4 21:18:07 2008
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    column p_1 format a3
    column p_2 format a10
    column p_3 format a30
    with data as
    select '1 AVENUE OF THE AMERICAS' as ADDRESS from dual union all
    select '2 NORTH CAROLINE STREET EAST' as ADDRESS from dual union all
    select '236 TURPENTINE ROAD COOPER CREEK' as ADDRESS from dual
    select
      regexp_replace( address, '^([^ ]+) (.+?) ([^ ]+)$', '\1' ) as p_1 ,
      regexp_replace( address, '^([^ ]+) (.+?) ([^ ]+)$', '\3' ) as p_2 ,
      regexp_replace( address, '^([^ ]+) (.+?) ([^ ]+)$', '\2' ) as p_3
    from
      data
    P_1 P_2        P_3
    1   AMERICAS   AVENUE OF THE
    2   EAST       NORTH CAROLINE STREET
    236 CREEK      TURPENTINE ROAD COOPER
    3 rows selected.
    -- or try this shorter version --
    with data as
    select '1 AVENUE OF THE AMERICAS' as ADDRESS from dual union all
    select '2 NORTH CAROLINE STREET EAST' as ADDRESS from dual union all
    select '236 TURPENTINE ROAD COOPER CREEK' as ADDRESS from dual
    select
      regexp_replace( address, '^([^ ]+).*', '\1' ) as p_1 ,
      regexp_replace( address, '.*?([^ ]+)$', '\1' ) as p_2 ,
      regexp_replace( address, '^([^ ]+) (.+?) ([^ ]+)$', '\2' ) as p_3
    from
      data
    P_1 P_2        P_3
    1   AMERICAS   AVENUE OF THE
    2   EAST       NORTH CAROLINE STREET
    236 CREEK      TURPENTINE ROAD COOPER
    3 rows selected.See SQL Snippets: SQL Features Tutorials - Regular Expressions if you're unfamiliar with regular expressions.
    If you can't / don't want to use regular expressions then you'll need to settle for a more boring approach like this one.
    with data as
    select '1 AVENUE OF THE AMERICAS' as ADDRESS from dual union all
    select '2 NORTH CAROLINE STREET EAST' as ADDRESS from dual union all
    select '236 TURPENTINE ROAD COOPER CREEK' as ADDRESS from dual
    select
      substr( address, 1, instr( address, ' ' ) - 1 ) as p_1 ,
      substr( address, instr( address, ' ', - 1 ) + 1 ) as p_2 ,
      substr
      ( address,
        instr( address, ' ', + 1 ) + 1,
        instr( address, ' ', - 1 ) - instr( address, ' ' ) - 1
      ) as p_3
    from
      data
    P_1 P_2        P_3
    1   AMERICAS   AVENUE OF THE
    2   EAST       NORTH CAROLINE STREET
    236 CREEK      TURPENTINE ROAD COOPER--
    Joe Fuda
    SQL Snippets

  • Split 1 column into multiple columns

    Hi
    How can we acheive this in Sql:
    Col 1
    abc def ghi jkl
    convert to:
    Col 1
    Col 2
    Col 3
    Col 4
    abc
    def
    ghi
    jkl
    Royal Thomas

    The best approach is to NOT split them out into individual columns... It violates the 1st normal form...
    Under first normal form, all occurrences of a record[sic] type must contain the same number of fields[sic].
    First normal form excludes variable repeating fields[sic] and groups.
    The better approach is to split them into rows, in their own table, with a foreign key reference back to the table you are pulling them away from.
    If you check my 1st post you'll see that I split the string with a function. That same a function can be used to populate the new table.
    Something along these lines...
    IF OBJECT_ID('tempdb..#BadOldDesign') IS NOT NULL
    DROP TABLE #BadOldDesign;
    CREATE TABLE #BadOldDesign (
    ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY,
    ListOfCodes VARCHAR(100) NOT NULL
    INSERT #BadOldDesign (ListOfCodes) VALUES
    ('abc htr tbj yfd hjk mth'),
    ('bbb hyt tbj vyk hjk htd'),
    ('vvv nud'),
    ('yyy hyn tbj bdr '),
    ('htr htf tbj yfd hjk mko'),
    ('kio bhn tbj bjd hjk'),
    ('byd loj tbj yfd hjk cds');
    SELECT * FROM #BadOldDesign bod
    IF OBJECT_ID('tempdb..#ShinyNewTable') IS NOT NULL
    DROP TABLE #ShinyNewTable;
    SELECT
    bod.ID,
    sc8.ItemNumber,
    sc8.Item
    INTO #ShinyNewTable
    FROM
    #BadOldDesign bod
    CROSS APPLY dbo.SplitCSVToTable8K(bod.ListOfCodes, ' ') sc8;
    ALTER TABLE #ShinyNewTable ALTER COLUMN id INT NOT NULL;
    GO
    ALTER TABLE #ShinyNewTable ALTER COLUMN ItemNumber INT NOT NULL;
    GO
    ALTER TABLE #ShinyNewTable ADD CONSTRAINT pk_ShinyNewTable PRIMARY KEY CLUSTERED (ID, ItemNumber);
    SELECT * FROM #ShinyNewTable snt
    The dbo.SplitCSVToTable8K function that I'm using can be found here... http://www.sqlservercentral.com/articles/Tally+Table/72993/
    HTH,
    Jason
    Jason Long

  • Printing into multiples columns on several pages

    Hi,
    I am looking for a way to print a list in TWO columns using SAPscript.
    Here is the SAPScript :
    /E   POS_ITEMS                                   
    L                                                      
    L    &itemno1&  &itemno2&
    a list that looks like this :
    apricot
    banana
    chick peas
    dill pickle
    egg
    french fries
    grapes
    would be processed to look like this with lines per page = 4 :
    apricot__________egg
    banana_________ french fries
    chick peas______grapes
    dill pickle
    and would be processed to look like this, with lines per page = 2 :
    apricot_________chick peas
    banana_________dill pickle
    egg____________grapes
    french fries
    Thanks!

    Maybe not pretty, but it works.
    It's an example with four columns.
    nb_col     = 4.
    nb_rangees = 6.
    DESCRIBE TABLE it_table LINES nb_lignes.
    nb_tableaux = ( nb_lignes DIV ( nb_rangees * nb_col ) ) + 1.
    IF nb_lignes < nb_rangees.
      nb_rangees = nb_lignes.
    ENDIF.
    pos = 1.
    DO nb_tableaux TIMES.
      DO nb_rangees TIMES.
      1re colonne
        index_col = pos.
        PERFORM lire_valeur USING index_col CHANGING chaine.
        WRITE:/ chaine.
      2e colonne
        index_col = pos + ( nb_rangees ).
        PERFORM lire_valeur USING index_col CHANGING chaine.
        WRITE: chaine.
      3e colonne
        index_col = pos + ( 2 * nb_rangees ).
        PERFORM lire_valeur USING index_col CHANGING chaine.
        WRITE: chaine.
      4e colonne
        index_col = pos + ( 3 * nb_rangees ).
        PERFORM lire_valeur USING index_col CHANGING chaine.
        WRITE: chaine.
        pos = pos + 1.
      ENDDO.
      pos = pos + ( ( nb_col - 1 ) * nb_rangees ).
    ENDDO.
    WRITE:/ 'FIN'.
          FORM lire_valeur                                              *
    FORM lire_valeur USING p_index
                     CHANGING p_valeur.
      CLEAR p_valeur.
      IF p_index <= nb_lignes.
        READ TABLE it_table INDEX p_index.
        p_valeur = it_table-nom.
      ENDIF.

  • How to transpose rows into multiple columns using pivot table

    I have 1 row containing 12 columns with value "JAN", "FEB", "MAR", "J-1","F-1","M-1","J-2","F-2","M-2","J-3","F-3","M-3"
    I want to display as
    JAN J-1 F-1 M-1
    FEB J-2 F-2 M-2
    MAR J-3 F-3 M-3
    How do I achieve the above?

    Today you have only 3 months JAN, FEB, MAR. Is it always the same number of columns. What if there are more months added to this row?
    Is your data really coming from relational source or some sort of text file?
    There is a better way to do this in narrative view using HTML if your requirement is just to show them in multiple rows and do some calculations.
    Go to Narrative View;
    In prefix, use <html> <table>
    In 'Narrative' text box add something like this
    <tr> <td> @1 </td> <td> @4 </td> <td> @7 </td> </tr>
    <tr> <td> @2 </td> <td> @5 </td> <td> @8 </td> </tr>
    <tr> <td> @3 </td> <td> @6 </td> <td> @9 </td> </tr>
    In Suffix, use </table> </html>
    You can also add simple calculations like sum etc at the very bottom of these rows as grand totals.
    kris

Maybe you are looking for