Solved

SSRS Create Blank Numbered Grid

Posted on 2014-03-31
3
568 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

15 Experts available now in Live!

Get 1:1 Help Now