Solved

SSRS Create Blank Numbered Grid

Posted on 2014-03-31
3
574 Views
Last Modified: 2014-04-01
I am try to create a form that will be printed from an SSRS Report. I would like to create a subreport to embed in the main report.

This subreport should print some column headings then a blank numbered grid:

Something like this:

    Col 1   |   Col 2  |   Col   3 |   Col 4
--------------------------------------------------
#1           |             |               |
#2           |             |               |
#3           |             |               |

Open in new window


I would like to send the subreport the number of rows to create - as a parameter.

Thank you in advance for your help!
0
Comment
Question by:wfwalshiii
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
Nico Bontenbal earned 500 total points
ID: 39968960
You could try with this SQL statement as the data source for the Grid:
;With Rows(Id) as
	(
		select 1 
		union all
		select id + 1 from rows where id < 42)
	select * from Rows
	OPTION (MAXRECURSION 42);

Open in new window

See http://technet.microsoft.com/en-us/library/ms186243(v=sql.105).aspx for more information about this technique. You can replace 42 with @GridRows (for example) to make it a parameter.
0
 

Author Comment

by:wfwalshiii
ID: 39970219
That works for what I asked. Thank you.

If I wanted to do this with the same idea, can I force SSRS to jump to next record mid-row?

    Col 1   |   Col 2  |   Col   3 |   Col 4
--------------------------------------------------
#1           |             | #2            |
#3           |             | #4            |
#5           |             | #6            |

Open in new window

0
 
LVL 22

Expert Comment

by:Nico Bontenbal
ID: 39970333
You could add a column grouping to your matrix and create a formula that returns true for even numbers and false for odd numbers, then group on that formula.
Another option is to change your code to:
;With Rows(Id) as
	(
		select 1 
		union all
		select id + 2 from rows where id < 42-1)
	select * from Rows
	OPTION (MAXRECURSION 42);

Open in new window

This will return the numbers for Col1 for you. On Col 3 you just add 1 to that number.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now