Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Display multiple column tab Expand / Collapse
Author
Message
Posted Wednesday, February 20, 2013 11:22 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, November 27, 2013 4:28 AM
Points: 21, 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
Post #1422408
Posted Thursday, February 21, 2013 12:11 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, October 6, 2014 5:46 AM
Points: 2,840, Visits: 3,969
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
Post #1422412
Posted Thursday, February 21, 2013 12:19 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, November 27, 2013 4:28 AM
Points: 21, 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.

  Post Attachments 
Design.png (7 views, 18.50 KB)
Display.png (4 views, 50.12 KB)
Post #1422414
Posted Thursday, February 21, 2013 12:23 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, October 6, 2014 5:46 AM
Points: 2,840, Visits: 3,969
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
Post #1422415
Posted Thursday, February 21, 2013 3:15 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 5:22 PM
Points: 1,793, Visits: 5,791
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


  • MMGrid Addin
  • MMNose Addin


  • 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



  •   Post Attachments 
    Groups.PNG (21 views, 28.92 KB)
    Filters.PNG (22 views, 42.77 KB)
    Design.PNG (21 views, 8.28 KB)
    Post #1422472
    « Prev Topic | Next Topic »

    Add to briefcase

    Permissions Expand / Collapse