all groups > sql server reporting services > may 2005 >
You're in the

sql server reporting services

group:

Forcing page breaks



Forcing page breaks Stan
5/5/2005 2:10:01 PM
sql server reporting services: Hello,

Apologies if this is a silly question. I am using Reporting services with
ODBC to convert print image text files into pdb files. Each record/line of
the file has one character code then the data for the line of the report. I
used odbc to describe the file to have 2 columns. The columns are ID and
Data.

Now for the question: I need to force a page break whenever the contents of
the ID column are a '1'. THis sounds like it should be really easy, but I
cannot seem to figure out how to do this.

Re: Forcing page breaks Wayne Snyder
5/5/2005 10:03:37 PM
I have an example on www.msbicentral.com which allows you to do a page break
after X number of lines. The example (if I remember correctly) uses an
expression for the page break. You could simply change the expression.

Search for Page or Page Break in the Downloads->Reporting Services ->RDL
section

--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org

[quoted text, click to view]

Re: Forcing page breaks Stan
5/6/2005 7:36:03 AM
Wayne,

Thanks for the tip. Unfortunately, I cannot seem to get it to work. My
data is tabular and not a matrix (tho I have tried both). When ever I add
any group the order of the data gets all fubar(ed) and I cannot seem to stop
it from doing this. The darn reports takes all the ID=1 rows(which is the
first line of each page) and puts them all at the top of the report.

Any more help you can off would be appreciated, but as always the search
continues.

Thanks

Stan



[quoted text, click to view]
Re: Forcing page breaks Mike G.
5/6/2005 4:25:59 PM
I would love to hear a better answer, but if there isn't any other way....

How about using a custom function that acts as a counter that incremented
every time there was a 1? So the data would look something like:

counter ID Data
0 | 0 | xyz
0 | 0 | xyz
0 | 0 | xyz
1 | 1 | xyz
1 | 0 | xyz
1 | 0 | xyz
2 | 1 | xyz
2 | 0 | xyz
2 | 0 | xyz
etc.

Then, you could group by that function and put page breaks after each group.
A simple function could look something like:

Private x As Integer

Public Function addone(ByVal num As Integer) As Integer
x = x + num
Return x
End Function

The function doesn't actually need to be on the report, just use it to
group. Insert a group and for the expression:
=code.addone(Fields!id.value)

Mike G.

[quoted text, click to view]

Re: Forcing page breaks Stan
5/10/2005 10:18:03 AM
Mike,

I was on this track, but could not get it right. You hit the nail right on
the head.

Thanks!!!

Stan

[quoted text, click to view]
AddThis Social Bookmark Button