0
votes

I am currently working on SSRS reports 2008 displaying them in Website created in VS 2010 i.e., ASP.NET 4.0 C#.

My current issue is I have a report with only a Letterhead on it. And this report page needs to be printed multiple times based on the value in number of pages TextBox as shown enter image description here


To be a bit descriptive:

When the user enters the value in Number of Pages TextBox and clicks on this Print button icon, he/she lands on the page with ReportViewer control on it, displaying the report.This report has only a letterhead in the PageHeader of the report and here this report will be printed by clicking the default print button of ReportViewer control.

But, I am unable to figure out, how to print this report page as many times as there will be the value in the No of Pages TextBox (as shown in the fig.)
(The Letterhead of the company to be shown in report is retrieved from database through a Stored Procedure)

I tried a lot of Googling but to no avail.

1
Your question is very hard to understand for me. You interchange "Number of Pages" and Number of Copies - perhaps you just mean the latter? Can you review your question, try to clarify a bit more? - Jeroen
@Jeroen I've changed the language of question and tried to make it simple, pls have a look at it - Irf
Aye, now it makes more sense! I'll second @JoaoLeal's answer then, that seems like it would do the trick. - Jeroen
@Jeroen But I tried Joao-Leal's answer but it is showing some errors - Irf

1 Answers

3
votes

Create a new report. This report should have 1 parameter called "number of copies" (or equivalent). It should also have a Tablix with 1 column and no borders, inside the cell insert a sub report pointing to the report with the letterhead.

Your dataset query should be something like this:

WITH dataset AS (
   SELECT 1 AS ID UNION ALL 
   SELECT ID + 1 FROM dataset WHERE ID < @Param
)
SELECT ID 
FROM dataset --edit: obviously I was missing the table
OPTION (MAXRECURSION 0)

Then on your tablix, use this dataset, group by ID and on the group properties select "Page Breaks"->"Between each instance of a group".

If I understood your question correctly, this should do the trick.