how to repeat the template twice in a row??

  • Hii

    My requirement for the Report is :

    Name:abc Age: 23 Name:hdfi Age:24

    Company: xyz Company:jfhigh

    Designation:hfdguiyeguh Designation:jhff

    Notes:Testing Notes Notes:jhggh

    Name:1234 Age: 23 Name:ghyiru Age:24

    Company:jfhighgjksghrkjgh Company: xyz

    Designation:hfdguiyeguh Designation:dgjgj

    Notes:jhggh Notes:Testing Notes

    As shown above after i prepare a template and it is a table; it is shown in ReportViewer control.I need to show the user data horizontally tiled(2 in each row).How can i achieve this??

    I am using SQL Server 2005 and Visula Studio 2005.

    Please let me know i hope it would be feasible..using any way or the other.

    Thanks

    Supriya

  • Hi,

    If you are using SSRS then you can do following things to achieve your goal:

    1. Create your dataset.

    -- I am taking following example according to your dummy data:-

    Declare @T table (Name varchar(20),Age int,company varchar(20),

    Designation varchar(50), Notes varchar(50))

    Insert into @T

    Select 'abc',23,'xyz','hfdguiyeguh','Testing Notes' union

    Select 'hdfi',24,'jfhigh','jhff','jhggh' union

    Select '1234',23,'jfhighgjksghrkjgh','hfdguiyeguh','jhggh' union

    Select 'ghyiru',24,'xyz','dgjgj','Testing Notes'

    Select * From @T

    2. Now darg and drop Two Table controls, one after another. Both Tables should have only one column. Copy and paste the folowing code in detail section of that column:

    ="Name:" & Fields!Name.Value & " Age:" & Fields!Age.Value & vbcrlf &

    "Company:" & Fields!company.Value & vbcrlf &

    "Designation:" & Fields!Designation.Value & vbcrlf &

    "Notes:" & Fields!Notes.Value

    3. Now write follwing expressions in Hidden property:-

    =IIF(RowNumber(Nothing) Mod 2 = 0, True, False) ' for First Table

    =IIF(RowNumber(Nothing) Mod 2 = 1, True, False) ' for Second Table

    Now Preview your report.

    Cheers 😛

  • Thanx for the reply..

    It seems that it wud work..

    coz there r two ways i believe to do this :

    first as u siad ro set the visibilty

    n second to make two datasets (datasource) which wud divide the data.

    -Supriya

Viewing 3 posts - 1 through 2 (of 2 total)

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