Showing posts with label force. Show all posts
Showing posts with label force. Show all posts

Friday, March 30, 2012

Page break after X items

Is it possible to force a page break after a specified number of items in a table?
For instance, I have a name badge report but I'm running into a problem where some badges are sliced down the middle at page breaks when exporting to pdf or tiff. If I could force a page break after every 2nd or 3rd badge it would alleviate that problem.

Thanks in advance.Figured it out. I added a group on Code.GetCount(RowNumber(Nothing)) with a page break at the end and added this function:


public shared function GetCount(CurrentCount As Integer) As Integer
If CurrentCount Mod 2 = 0 Then
GetCount = CurrentCount-1
Else
GetCount = CurrentCount
End If
end function

|||

Hello Nblankton

that was a very good idea, I did try to use it but for some reason it only works with 2 records.

I tried to change it with Mod 4 (I thought that would break after 4 records but that is not the case, I page break after the 1,2 and 4th record).

I'm not sure if I'm missing something or it is a bug.

Any Idea?

Thank you

MQ

|||

You'd also need to also alter the CurrentCode-1 line to subtract the appropriate number so that for all four that returned number is the same.

Something like CurrentCode-(CurrentCode Mod 4)+1.

I worked out a different method later that I think is a little clearer, though. This groups by 3's:

public shared function GetCount(CurrentCount As Integer) As Integer
GetCount = (CurrentCount+1)/3
end function

|||

Hi Nblankton

thank you for the response, after I wrote the note I searched the forum and found this

"=Ceiling(RowNumber(Nothing)/4)" you can put any number (2,5,20) it works, without having to add any code.

Thank you for your help. adding a group to control the amount of record per page is a great idea.

MQ

|||hi, I hope someone can help me!
I don't understand where I must place "=Ceiling(RowNumber(Nothing)/4)"

I added a new group (I selected table, right-click Proprieties, groups and add)
and I've write "=Ceiling(RowNumber(Nothing)/4)" as expression, but when I tried to execute , an error rose!
A scope problem

did I wrong the place to write the expression?

Thanks in advance
sql

Page break after X items

Is it possible to force a page break after a specified number of items in a table?
For instance, I have a name badge report but I'm running into a problem where some badges are sliced down the middle at page breaks when exporting to pdf or tiff. If I could force a page break after every 2nd or 3rd badge it would alleviate that problem.

Thanks in advance.Figured it out. I added a group on Code.GetCount(RowNumber(Nothing)) with a page break at the end and added this function:


public shared function GetCount(CurrentCount As Integer) As Integer
If CurrentCount Mod 2 = 0 Then
GetCount = CurrentCount-1
Else
GetCount = CurrentCount
End If
end function

|||

Hello Nblankton

that was a very good idea, I did try to use it but for some reason it only works with 2 records.

I tried to change it with Mod 4 (I thought that would break after 4 records but that is not the case, I page break after the 1,2 and 4th record).

I'm not sure if I'm missing something or it is a bug.

Any Idea?

Thank you

MQ

|||

You'd also need to also alter the CurrentCode-1 line to subtract the appropriate number so that for all four that returned number is the same.

Something like CurrentCode-(CurrentCode Mod 4)+1.

I worked out a different method later that I think is a little clearer, though. This groups by 3's:

public shared function GetCount(CurrentCount As Integer) As Integer
GetCount = (CurrentCount+1)/3
end function

|||

Hi Nblankton

thank you for the response, after I wrote the note I searched the forum and found this

"=Ceiling(RowNumber(Nothing)/4)" you can put any number (2,5,20) it works, without having to add any code.

Thank you for your help. adding a group to control the amount of record per page is a great idea.

MQ

|||hi, I hope someone can help me!
I don't understand where I must place "=Ceiling(RowNumber(Nothing)/4)"

I added a new group (I selected table, right-click Proprieties, groups and add)
and I've write "=Ceiling(RowNumber(Nothing)/4)" as expression, but when I tried to execute , an error rose!
A scope problem

did I wrong the place to write the expression?

Thanks in advance

Page break after X items

Is it possible to force a page break after a specified number of items in a table?
For instance, I have a name badge report but I'm running into a problem where some badges are sliced down the middle at page breaks when exporting to pdf or tiff. If I could force a page break after every 2nd or 3rd badge it would alleviate that problem.

Thanks in advance.Figured it out. I added a group on Code.GetCount(RowNumber(Nothing)) with a page break at the end and added this function:


public shared function GetCount(CurrentCount As Integer) As Integer
If CurrentCount Mod 2 = 0 Then
GetCount = CurrentCount-1
Else
GetCount = CurrentCount
End If
end function

|||

Hello Nblankton

that was a very good idea, I did try to use it but for some reason it only works with 2 records.

I tried to change it with Mod 4 (I thought that would break after 4 records but that is not the case, I page break after the 1,2 and 4th record).

I'm not sure if I'm missing something or it is a bug.

Any Idea?

Thank you

MQ

|||

You'd also need to also alter the CurrentCode-1 line to subtract the appropriate number so that for all four that returned number is the same.

Something like CurrentCode-(CurrentCode Mod 4)+1.

I worked out a different method later that I think is a little clearer, though. This groups by 3's:

public shared function GetCount(CurrentCount As Integer) As Integer
GetCount = (CurrentCount+1)/3
end function

|||

Hi Nblankton

thank you for the response, after I wrote the note I searched the forum and found this

"=Ceiling(RowNumber(Nothing)/4)" you can put any number (2,5,20) it works, without having to add any code.

Thank you for your help. adding a group to control the amount of record per page is a great idea.

MQ

|||hi, I hope someone can help me!
I don't understand where I must place "=Ceiling(RowNumber(Nothing)/4)"

I added a new group (I selected table, right-click Proprieties, groups and add)
and I've write "=Ceiling(RowNumber(Nothing)/4)" as expression, but when I tried to execute , an error rose!
A scope problem

did I wrong the place to write the expression?

Thanks in advance

page break after 10 rows

I have a report with 1 grouping level, and I want to display only 10 records
per page. How can I force this grouping in RS, can I use functions like
Rownumber, and how precisely does it work ?Yes, search this forum, it's been mentioned loads of times in here.
Effectively use the RowNumber function divided by 10 with the Ceiling
function.
--
Regards
Chris
joia wrote:
> I have a report with 1 grouping level, and I want to display only 10
> records per page. How can I force this grouping in RS, can I use
> functions like Rownumber, and how precisely does it work ?|||Hi, the easiest way to do it, as i found out, is using this function:
System.Math.Ceiling (RowNumber (Nothing)/10)
where 10 can be replaced by a report parameter.
Cheers, Johan
"Chris McGuigan" wrote:
> Yes, search this forum, it's been mentioned loads of times in here.
> Effectively use the RowNumber function divided by 10 with the Ceiling
> function.
> --
> Regards
> Chris
> joia wrote:
> > I have a report with 1 grouping level, and I want to display only 10
> > records per page. How can I force this grouping in RS, can I use
> > functions like Rownumber, and how precisely does it work ?
>|||I am new to reporting services. Can you show me how to use this function?
Thanks,
Anna
"joia" wrote:
> Hi, the easiest way to do it, as i found out, is using this function:
> System.Math.Ceiling (RowNumber (Nothing)/10)
> where 10 can be replaced by a report parameter.
> Cheers, Johan
> "Chris McGuigan" wrote:
> > Yes, search this forum, it's been mentioned loads of times in here.
> > Effectively use the RowNumber function divided by 10 with the Ceiling
> > function.
> > --
> > Regards
> > Chris
> >
> > joia wrote:
> >
> > > I have a report with 1 grouping level, and I want to display only 10
> > > records per page. How can I force this grouping in RS, can I use
> > > functions like Rownumber, and how precisely does it work ?
> >|||I figure out how to use this function now.
Thank you for sharing this function.
Anna :)
"Anna" wrote:
> I am new to reporting services. Can you show me how to use this function?
> Thanks,
> Anna
> "joia" wrote:
> > Hi, the easiest way to do it, as i found out, is using this function:
> > System.Math.Ceiling (RowNumber (Nothing)/10)
> >
> > where 10 can be replaced by a report parameter.
> >
> > Cheers, Johan
> >
> > "Chris McGuigan" wrote:
> >
> > > Yes, search this forum, it's been mentioned loads of times in here.
> > > Effectively use the RowNumber function divided by 10 with the Ceiling
> > > function.
> > > --
> > > Regards
> > > Chris
> > >
> > > joia wrote:
> > >
> > > > I have a report with 1 grouping level, and I want to display only 10
> > > > records per page. How can I force this grouping in RS, can I use
> > > > functions like Rownumber, and how precisely does it work ?
> > >