SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Display multiple column tab


Display multiple column tab

Author
Message
baseehkhan
baseehkhan
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
Points: 23 Visits: 98
Hi All,
My source is like

Id Name
1 A
2 B
3 C
4 D
5 E
6 F
7 G
8 H
9 I
10 J
. .
. .
. .



I have display like:


ID Name ID Name
1 A 6 F
2 B 7 G
3 C 8 H
4 D 9 I
5 E 10 J

After end with this page, Values go to the next page.


Thanks,

Basee
Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5260 Visits: 4076
I think you are talking about pagination here. this can be done at application and sql server both.
search google for "row_number()"

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
baseehkhan
baseehkhan
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
Points: 23 Visits: 98
This what they designed in crystal report. If the column reaches the end on one side the next values is goes to the right side. After ending the page it goes to the new page.
Attachments
Design.png (10 views, 18.00 KB)
Display.png (11 views, 50.00 KB)
Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5260 Visits: 4076
i am not a .net guy, you should search in .net forums like codeproject for this .

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
mister.magoo
mister.magoo
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4124 Visits: 7865
It's actually not that hard...

Step 1. You need your dataset to include a few extra columns


;with data as
(
select GroupName,ArticleNumber,Subject,row_number() over(PARTITION BY GroupName order by ArticleNumber) as rn
FROM Articles
where Subject <>''
)
select TOP 200
GroupName,
ArticleNumber,
Subject,
rn, -- used for sorting the output
((rn-1) / 10) %2 as col_no, -- works out which column to put the data into : 0 or 1 (based on page size of 10 - this could /should be a parameter )
((rn-1) / 10) /2 as page_break -- works out which "page" within the group to put the data on (based on page size of 10 - this could /should be a parameter )
from data




Step 2. Create a Tablix report with "GroupName" on the Page section and ArticleNumber and subject on the details section (you can include the other columns for now so you can see it is working, but remove them later for production)

Step 3. You now need to tell the report how to paginate, so go into the outermost group properties (you would have an outer grouping called list1_GroupName if you were doing this with my data) and add the dataset column "page_break" to the group expressions so you are grouping by GroupName and page_break.



Step 4. put a filter on the "detail" tablix so that it only displays where "col_no" = 0



Step 5. Select any textbox that could expand due to overflow of data and uncheck the "Allow height to increase ?" setting. (otherwise your report will not line up nicely)

Step 6. Select the outer Tablix (called List1 if you used the wizard) and make it twice as wide.

Step 7. Copy the inner/details Tablix and paste it into List1, then position it right next to existing one (side by side)

Step 8. Edit the filter on the new (2nd) details tablix so that it only displays where "col_no" = 1



MM


select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);




  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Attachments
    Groups.PNG (25 views, 28.00 KB)
    Filters.PNG (24 views, 42.00 KB)
    Design.PNG (23 views, 8.00 KB)
    Go


    Permissions

    You can't post new topics.
    You can't post topic replies.
    You can't post new polls.
    You can't post replies to polls.
    You can't edit your own topics.
    You can't delete your own topics.
    You can't edit other topics.
    You can't delete other topics.
    You can't edit your own posts.
    You can't edit other posts.
    You can't delete your own posts.
    You can't delete other posts.
    You can't post events.
    You can't edit your own events.
    You can't edit other events.
    You can't delete your own events.
    You can't delete other events.
    You can't send private messages.
    You can't send emails.
    You can read topics.
    You can't vote in polls.
    You can't upload attachments.
    You can download attachments.
    You can't post HTML code.
    You can't edit HTML code.
    You can't post IFCode.
    You can't post JavaScript.
    You can post emoticons.
    You can't post or upload images.

    Select a forum

































































































































































    SQLServerCentral


    Search