I am working on a database using SQL Server 2012 and C# on Visual Studio.NET 2010.
I am using Reportviewer to create various reports with no problems so far. I have a specific problem that has been puzzling me for some time and I can't find a satisfactory solution.
I have a table which represents a box of sample tubes that contains 100 tubes which are aranged in a 10x10 gridlike this:
My table has the following fields:
Position|Horizontal|Vertical|Value
Example Data Rows:
1|1|1|Sample1
2|1|2|Sample2
3|1|3|Sample3
and so on until
100|10|10|Sample100
Now I want to be able to print the contents of this table similar to the grid figure, in a 10x10 grid. Something like this
How can I display data rows from my table in Rportviewer in one row and after 10 columns go to the next line to print the next 10 etc, in order to create a grid that looks like the real box of samples?
I tried creating a data list and a multicolumn Report after following this tutorial:"Creating Mailing Labels in SQL Server Reporting Services" but the data gets printed sequentially all in the first column, then goes to the second column to continue from
where its left off and the grid is somehow inverted from what i want it to look like.
Has anyone tried to prinf a report using a grid and print data in rows instead of columns?
For this you might need to add some kind of counters to your dataset like RowNumver, Column Number and Pagenumber. You can do that by some sql calculations. Once you have that , you can folloow these steps :
1.Add a table with one column only and row group on "Sample".
2.Now add another table with 1 row and 1 column only. Delete the default group. Add a parent column group on it for your ColumnNumber/RowNumber parameter.
3. Now cut and paste the previous table in this table. This should help in getting desired result.
This seems like it could be done by simply creating a row group on your horizontal field and a column group on your vertical field and using your value field for your detailed data.
Can you elaborate please? Row group will be applied on a specific value of the table? WIll I be able to go to the next row after 10 values with the rowgroup? Thank you for your answers.
None
0 Points
2 Posts
Display table data with Reportviewer as columns instead of rows
Jun 21, 2013 06:01 AM|nipddatabase|LINK
Hello all,
I am working on a database using SQL Server 2012 and C# on Visual Studio.NET 2010.
I am using Reportviewer to create various reports with no problems so far. I have a specific problem that has been puzzling me for some time and I can't find a satisfactory solution.
I have a table which represents a box of sample tubes that contains 100 tubes which are aranged in a 10x10 gridlike this:
My table has the following fields:
Position|Horizontal|Vertical|Value
Example Data Rows:
1|1|1|Sample1
2|1|2|Sample2
3|1|3|Sample3
and so on until
100|10|10|Sample100
Now I want to be able to print the contents of this table similar to the grid figure, in a 10x10 grid. Something like this
1 SAmple 1 |2 Sample 2 |3 Sample 3 |4...|10 Sample 10|
11 Sample 11| 12 Empty |13 Sample 13 |...|
21 Sample 21|...|
...
How can I display data rows from my table in Rportviewer in one row and after 10 columns go to the next line to print the next 10 etc, in order to create a grid that looks like the real box of samples?
I tried creating a data list and a multicolumn Report after following this tutorial:"Creating Mailing Labels in SQL Server Reporting Services" but the data gets printed sequentially all in the first column, then goes to the second column to continue from where its left off and the grid is somehow inverted from what i want it to look like.
Has anyone tried to prinf a report using a grid and print data in rows instead of columns?
I appreciate any input you might have.
Member
220 Points
64 Posts
Re: Display table data with Reportviewer as columns instead of rows
Jun 21, 2013 08:26 AM|Abhi.ssrs|LINK
Hi,
<div>For this you might need to add some kind of counters to your dataset like RowNumver, Column Number and Pagenumber. You can do that by some sql calculations. Once you have that , you can folloow these steps :
1.Add a table with one column only and row group on "Sample".
2.Now add another table with 1 row and 1 column only. Delete the default group. Add a parent column group on it for your ColumnNumber/RowNumber parameter.
3. Now cut and paste the previous table in this table. This should help in getting desired result.
Thanks!
AB
</div>Member
10 Points
3 Posts
Re: Display table data with Reportviewer as columns instead of rows
Jun 21, 2013 04:40 PM|FrumRoll|LINK
This seems like it could be done by simply creating a row group on your horizontal field and a column group on your vertical field and using your value field for your detailed data.
None
0 Points
2 Posts
Re: Display table data with Reportviewer as columns instead of rows
Jun 25, 2013 02:03 AM|nipddatabase|LINK
Can you elaborate please? Row group will be applied on a specific value of the table? WIll I be able to go to the next row after 10 values with the rowgroup? Thank you for your answers.
Participant
1130 Points
349 Posts
Re: Display table data with Reportviewer as columns instead of rows
Jun 25, 2013 09:55 AM|sridhar_rs|LINK
You could use DataList control with RepeatColumns=10 to show 10 X n rows grid format.
<asp:DataList ID="DataList1" RepeatDirection="Horizontal" BorderStyle="solid" BorderWidth="2" RepeatLayout="Table" RepeatColumns="10" runat="server">
<asp:Literal ID="Literal1" Text='<%# Container.DataItem("position") + " " + Container.DataItem("value") %>' runat="server" />
</asp:DataList>
.RS.
Thank you very much,
Please if my reply helped you.