How to merge whole Column to get end result-a Single Cell

  • Hi all,

    I want to merge the first column of my report dynamically to make it appear as a single cell

    here is the image - https://www.sqlservercentral.com/Forums/Uploads/image-unavailable.png

    Please help.

    Thanks in advance,

    maxE

  • Could you post the query you are using please?

  • actually its not the Database problem.

    I am getting this problem in REPORTING SERVICES.

    I have a table and have to make first column appear as a single cell(as in image) with all rows merge for that only column dynamically.

    thanks for your reply though..

  • If i understood what you are asking, here is the code

    declare @idemp nvarchar(max) ,@onecell nvarchar(max);

    declare curs cursor for

    select FIELD from TABLE

    open curs

    fetch next from curs into @idemp;

    set @onecell = ' ';

    while @@FETCH_STATUS = 0

    begin

    set @onecell = @onecell + ' ' + @idemp ;

    fetch next from curs into @idemp;

    end

    close curs

    deallocate curs

    select @onecell;

    What this does is to put all the results from the query into one cell, the answer was cursors.

    Tell me if it helps.

    Hernan.-

  • again, thanks for your reply

    but as i said its not the backend problem , rather its a UI problem.

    I am using reporting services to generate report and i have a table , in that table the value in first column is static.

    i have to make that column with static value, dynamically merged,depending on the number of rows generating dynamically in other columns.

  • Select all of the columns and right click on that. Select MergeCells

    Done.

    Hope that helps

    -RP

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply