Thursday, March 22, 2012
Conditionally Send Email Subscription
I've written reports and deployed them with data-driven subcriptions. I
have a new requirement and would like to know if there is a solution I
can impliment to conditionally send an email to a recipient "ONLY" if
the report to this specific recipient contains data. If I'm correct,
the data-driven query will send an email to each in the result set of
the query whether the report contains data or not.
Am I on the right track and is this possible?
Thank in advance!
Kind regards - FredHi Igor,
> One solution would be if you can implement your data-driven (DD) query in a
> way that returns a user only if data for this user exists. Alternative is
> writing a custom delivery - then you have a complete control over the send
> logic. Otherwise you're right: email is sent to each in the result set of
> the DD query whether the report contains data or not.
I'll most liekly go with the DD query up front as a better solution.
Just wanted to see if there was something I'm missing. Thanks for your
input.
Regards - Fred
Monday, March 19, 2012
Conditional suppression formula PLEASE HELP
{InvoiceDetail.PartNumber} = previous({InvoiceDetail.PartNumber})
That did a great job of eliminated the duplicates but I found out that I have some orders that are in succesion with identical part numbers and they were being suppressed so I tried this formula
{InvoiceDetail.PartNumber} and {InvoiceHeader.SONumber} = previous({InvoiceDetail.PartNumber}) and {InvoiceHeader.SONumber}
thinking that will suppress any field that has the same part number and so number but it errors our and tells me I need a boolean.
I've tried just about everything and Im sure im missing something very simple but I dont know what it is.
PLEASE HELP{InvoiceDetail.PartNumber} and {InvoiceHeader.SONumber} = previous({InvoiceDetail.PartNumber}) and {InvoiceHeader.SONumber}
The very first thing is try to find out why you are getting duplicate data. Something must be wrong with you linking.
To suppress try this:
{InvoiceDetail.PartNumber} = previous({InvoiceDetail.PartNumber}) AND {InvoiceHeader.SONumber} = previous({InvoiceHeader.SONumber})
Thursday, March 8, 2012
Conditional Page Header
Example: If Company_Name = 'xyz' then unhide page header A
thanks in advance
cgInstead of hard coding the header,write a formula like :
if companyname = 'xyz' then
'Header name'
else
' '
and drag the formula in page header!
or
right click on Page header section,select Section Expert,select Common Tab,
click formula button on right of suppress button ,and write
companyname <> 'xyx'|||how exactly do i do this in Crystal? I will have to do the same for the footer too.
thanks
cg|||you mean writing the formula ?
I think you should go for 2nd option for both header and footer i.e suppress the section based on your condition.|||i tried the conditional supressing the header and it is not working.
i have tried with and with out checking the supress box with the formula in there.
this is what i have in the formula, the first 2 are the same. i was testing if it was case sensitive or not. this is a parameter field instead of a db field.
{?CustomerName} <> "Typenex Medical, LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL, LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL L.L.C."
or
{?CustomerName} <> "TYPENEX"
or
{?CustomerName} <> "TYPENEX LLC"
not sure if this makes a difference but i have version 8.5
thanks
cg|||i tried the conditional supressing the header and it is not working.
i have tried with and with out checking the supress box with the formula in there.
this is what i have in the formula, the first 2 are the same. i was testing if it was case sensitive or not. this is a parameter field instead of a db field.
{?CustomerName} <> "Typenex Medical, LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL, LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL L.L.C."
or
{?CustomerName} <> "TYPENEX"
or
{?CustomerName} <> "TYPENEX LLC"
not sure if this makes a difference but i have version 8.5
thanks
cg
You have written the expression wrong.
Whatever you have written will be always true in any condition. Just check it properly. Use
NOT (condition1 AND condition2 AND so on)|||Make it simple :
- Right click on Formula field in field explorer
- click New
-name your formula
Type this
if {?CustomerName} <> 'ABC' and {?CustomerName} <> 'XYZ' then
' '
else
'HEADER'
Drag the formula field in report where you want to print the header.
Conditional page breaks in SSRS
Hi,
I am having trouble setting conditional page breaks to my reports.
i.e... I am having a report where I need to allow user the option to set page break between a group or not.
Based upon the option selected by the user, I need to add page break to the report. I tried with all possibilities inside Sort and Group dialog box, but could not figure out how to toggle the option at runtime.
Does anyone know how to implement page breaks on runtime? Help me plzzzz!! I really need this to be done…Thanx in advance for any help..
- Rayz
OK, I think I have succeeded in doing this...
create a boolean parameter, something like PageBreak --I would give it a default value, but it doesn't appear to be necessary if you don't want it.
create a group with "page break at end", as you normally would. Don't put anything in its header and footer lines.
here's the trick: make this group's grouip expression an IIF() containing your "real" group expression,
something like the following example:|||
I tried it out ..but no luck for me
Wherever i apply page break..it seems it wont take the condition that i've specified..and pagebreaks appears permanently..even if i dont put pagebreak no..the page break comes..
Thanks for your suggestion
-Rayz
|||Well, let's see...
>>it seems it wont take the condition that i've specified..and pagebreaks appears permanently
What is the condition you've specified?
Also, to make sure I can repro, is this an RDL or RDLC?
>L<
|||Perhaps you should extend the syntax that Lisa has shown with the IIF() function. If you set the group expression as previously mentioned and add a field reference that is global to the report instead of the empty field ( "" ) then perhaps this evaluate correctly.
=IIF(Parameters!PageBreak.Value, Fields!MyField.Value, Fields!MyMostGlobalField.Value)
This way you will get a field reference to evaluate the grouping to. You may additionally want to hide this group with a "Visibility" expression on the group, though you may still get a page break before your report footer if one exists.
Hope this helps.
-Paul R.
|||
Hi Paul,
It actually does work fine with the "" -- and in the past I've done this with other "global/invariant" expressions -- such as True or 1. Is there some reason why this is a bad idea?
BTW another way I do this, without an IIF(), is to group on a variable and increment the variable in code when I want to force a page break -- I haven't tried that in RS and it can be a little more difficult to manage in general. So I didn't try it in response to this query. I will try it if you think it's a better idea.
Regrads,
>L<
|||Thanx a bunch Lisa....
ur initial suggestion worked !!
Thanks for confirming!
>L<
|||Hi,
I have five tables in a report which has to be repeated on every sheet of excel based on a variable
Can i also use the same condition?
Kindly help me out.
Thanks in advance
Nalini
|||"Every sheet of Excel" is basically "every explicitly-requested page of the report". By that I mean you get a sheet for each page break you explicitly asked for with a page break condition, rather than the report just deciding that it has to page break based on some constraints of the host format (for example, physical page size).
So, "Excel" shouldn't be handled specifically when trying to repeat tables -- it should work the way you want, if you get the explicit page break requests correct.
I will assume you understand this (I almost wrote "that we're on the same page" <g>) and ignore the "Excel" part of the question...
So, you want to have five tables that you want to see on each page. Can you tell me some more about your layout, what each of the tables represent from the point of view of datasets? Are they related to each other or completely distinct, data-wise? Is there additional data in the report? are the tables positioned adjacent to each other vertically, or horizontally, or what?
>L<
Conditional page breaks in SSRS
Hi,
I am having trouble setting conditional page breaks to my reports.
i.e... I am having a report where I need to allow user the option to set page break between a group or not.
Based upon the option selected by the user, I need to add page break to the report. I tried with all possibilities inside Sort and Group dialog box, but could not figure out how to toggle the option at runtime.
Does anyone know how to implement page breaks on runtime? Help me plzzzz!! I really need this to be done…Thanx in advance for any help..
- Rayz
OK, I think I have succeeded in doing this...
create a boolean parameter, something like PageBreak --I would give it a default value, but it doesn't appear to be necessary if you don't want it.
create a group with "page break at end", as you normally would. Don't put anything in its header and footer lines.
here's the trick: make this group's grouip expression an IIF() containing your "real" group expression,
something like the following example:|||
I tried it out ..but no luck for me
Wherever i apply page break..it seems it wont take the condition that i've specified..and pagebreaks appears permanently..even if i dont put pagebreak no..the page break comes..
Thanks for your suggestion
-Rayz
|||Well, let's see...
>>it seems it wont take the condition that i've specified..and pagebreaks appears permanently
What is the condition you've specified?
Also, to make sure I can repro, is this an RDL or RDLC?
>L<
|||Perhaps you should extend the syntax that Lisa has shown with the IIF() function. If you set the group expression as previously mentioned and add a field reference that is global to the report instead of the empty field ( "" ) then perhaps this evaluate correctly.
=IIF(Parameters!PageBreak.Value, Fields!MyField.Value, Fields!MyMostGlobalField.Value)
This way you will get a field reference to evaluate the grouping to. You may additionally want to hide this group with a "Visibility" expression on the group, though you may still get a page break before your report footer if one exists.
Hope this helps.
-Paul R.
|||
Hi Paul,
It actually does work fine with the "" -- and in the past I've done this with other "global/invariant" expressions -- such as True or 1. Is there some reason why this is a bad idea?
BTW another way I do this, without an IIF(), is to group on a variable and increment the variable in code when I want to force a page break -- I haven't tried that in RS and it can be a little more difficult to manage in general. So I didn't try it in response to this query. I will try it if you think it's a better idea.
Regrads,
>L<
|||Thanx a bunch Lisa....
ur initial suggestion worked !!
Thanks for confirming!
>L<
|||Hi,
I have five tables in a report which has to be repeated on every sheet of excel based on a variable
Can i also use the same condition?
Kindly help me out.
Thanks in advance
Nalini
|||"Every sheet of Excel" is basically "every explicitly-requested page of the report". By that I mean you get a sheet for each page break you explicitly asked for with a page break condition, rather than the report just deciding that it has to page break based on some constraints of the host format (for example, physical page size).
So, "Excel" shouldn't be handled specifically when trying to repeat tables -- it should work the way you want, if you get the explicit page break requests correct.
I will assume you understand this (I almost wrote "that we're on the same page" <g>) and ignore the "Excel" part of the question...
So, you want to have five tables that you want to see on each page. Can you tell me some more about your layout, what each of the tables represent from the point of view of datasets? Are they related to each other or completely distinct, data-wise? Is there additional data in the report? are the tables positioned adjacent to each other vertically, or horizontally, or what?
>L<
|||Lisa, I tried your approach and found two problems that I still can't figure out.
1) I had to do the Page break before the sections rather than after section in order for it to work.
2) I need to be able to choose the group level to page break on OR choose that no page break occurs at all. In this pursuit, I can't find a solution. Even if the Parameter!PageBreak criteria is not met, the top level group always page breaks. I need the ability to eliminate the page break as one of my options.
Any ideas?
|||Well, it definitely does work and should not require page break before -- in fact using page break before might be why you're saying "top level always breaks".
I am not on a machine where I have any of these examples, and, clearly, we need to take this from the top.
Can I have a clear(er) statement of exactly what you've done so far in this report and also a separate statement of what the requirements are? This would optimally include some simplified SELECT or other way that I can repro exactly what your group breaks look like, there may be some collision that we have to account for that wasn't in the original suggestion (or maybe the collision *can't* be accounted for in your situation -- right now I honestly have no idea).
I'm leaving for the day now, so no rush on your response <s>
>L<
|||I just created a stripped down sample report, and the issue with using page break after went away, but the other issue remains. I have a parameter named PageBreak with three option values: NONE, GROUP1, and GROUP2. When i choose NONE, it should always evaluate the Group1pre and Group2pre as ="" and therefore never cause a page break during the report. Unfortunately, it still causes the GROUP1 page breaks even if I choose NONE.
I created four group levels sequenced as follows (as seen in the Groups tab of Table Properties) and a detail row with the Detail values:
table1_Group1pre, page break at end checked, group expression =IIF(Parameters!PageBreak.Value="GROUP1",Fields!Group1.Value,"")
table1_Group1, no page breaks, group expression =Fields!Group1.Value
table1_Group2pre, page break at end checked, group expression =IIF(Parameters!PageBreak.Value="GROUP2",Fields!Group2.Value,"")
table1_Group2, no page breaks, group expression =Fields!Group2.Value
Here is the data set I created for testing.
select 'ABC' as Group1, '123' as Group2, 'slfje' as Data
union all
select 'ABC' as Group1, '123' as Group2, 'redfg' as Data
union all
select 'ABC' as Group1, '123' as Group2, 'wqsde' as Data
union all
select 'ABC' as Group1, '456' as Group2, 'rdrgd' as Data
union all
select 'ABC' as Group1, '456' as Group2, 'f5e4s6' as Data
union all
select 'ABC' as Group1, '789' as Group2, 'rhfth' as Data
union all
select 'ABC' as Group1, '789' as Group2, 'effgfg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'kuhjg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'efjklrg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'euurio' as Data
union all
select 'DEF' as Group1, '654' as Group2, 'wesdf' as Data
union all
select 'GHI' as Group1, '789' as Group2, 'yghfg' as Data
union all
select 'GHI' as Group1, '789' as Group2, '56215hh' as Data
union all
select 'GHI' as Group1, '456' as Group2, 'hbvfg' as Data
union all
select 'GHI' as Group1, '456' as Group2, 't456e4w' as Data
union all
select 'GHI' as Group1, '123' as Group2, 'ouuyf' as Data
union all
select 'GHI' as Group1, '123' as Group2, '5f4g8r9' as Data
union all
select 'GHI' as Group1, '123' as Group2, 'zzzzzzzz' as Data
Thank you for taking such care to provide a reproducible sample. I will check this out and write back, whether I can do this or not, and I have no idea at the moment <s>. I do know that it's a chancey thing, and it's often tricky to get the conditional expressions right, so I usually take a while to get it to work.
Anyway, I'll give this a shot and report back...
>L<
|||OK -- you can do this, it will work <s>. What you're missing (I think) is that you have to put the conditionals on the outer rim of the "real" groups. IOW, your group order is this:
Group1pre
Group1
Group2pre
Group2
... and it is quite possible that it would have worked something like this:
Group1pre
Group2pre
Group1
Group2
... although I didn't try it that way.
What I did try successfully, and what appears to follow the "rules of engagement" as I understand them (my understanding being without inside knowledge, just observation, and is admittedly imperfect!), is this:
GroupsPre
Group1
Group2
... using the following expression as my conditional break on GroupsPre:
Code Snippet
=IIF(Parameters!PageBreak.Value="NONE","",
IIF(Parameters!PageBreak.Value="GROUP1",
Fields!Group1.Value,
Fields!Group2.Value)
)
I want to say one other thing, based on your sample data -- which may be compounded in something you're doing in your "real" data set:
I am not sure what effect you are after on the inner group break, but you may have to dynamically sort your data to get the effect you are after when the break is on "GROUP2" (your inner group as expressed in the report). It is certainly possible to do this, of course, and I'm not even sure that is an issue for you.
[LSN Editing next morning: instead of dynamic orderng you can probably concatenate the value in the last part of the expression as csi_hugh shows in the next post]
Regards,
>L<
Conditional page breaks in SSRS
Hi,
I am having trouble setting conditional page breaks to my reports.
i.e... I am having a report where I need to allow user the option to set page break between a group or not.
Based upon the option selected by the user, I need to add page break to the report. I tried with all possibilities inside Sort and Group dialog box, but could not figure out how to toggle the option at runtime.
Does anyone know how to implement page breaks on runtime? Help me plzzzz!! I really need this to be done…Thanx in advance for any help..
- Rayz
OK, I think I have succeeded in doing this...
create a boolean parameter, something like PageBreak --I would give it a default value, but it doesn't appear to be necessary if you don't want it.
create a group with "page break at end", as you normally would. Don't put anything in its header and footer lines.
here's the trick: make this group's grouip expression an IIF() containing your "real" group expression,
something like the following example:|||
I tried it out ..but no luck for me
Wherever i apply page break..it seems it wont take the condition that i've specified..and pagebreaks appears permanently..even if i dont put pagebreak no..the page break comes..
Thanks for your suggestion
-Rayz
|||Well, let's see...
>>it seems it wont take the condition that i've specified..and pagebreaks appears permanently
What is the condition you've specified?
Also, to make sure I can repro, is this an RDL or RDLC?
>L<
|||Perhaps you should extend the syntax that Lisa has shown with the IIF() function. If you set the group expression as previously mentioned and add a field reference that is global to the report instead of the empty field ( "" ) then perhaps this evaluate correctly.
=IIF(Parameters!PageBreak.Value, Fields!MyField.Value, Fields!MyMostGlobalField.Value)
This way you will get a field reference to evaluate the grouping to. You may additionally want to hide this group with a "Visibility" expression on the group, though you may still get a page break before your report footer if one exists.
Hope this helps.
-Paul R.
|||
Hi Paul,
It actually does work fine with the "" -- and in the past I've done this with other "global/invariant" expressions -- such as True or 1. Is there some reason why this is a bad idea?
BTW another way I do this, without an IIF(), is to group on a variable and increment the variable in code when I want to force a page break -- I haven't tried that in RS and it can be a little more difficult to manage in general. So I didn't try it in response to this query. I will try it if you think it's a better idea.
Regrads,
>L<
|||Thanx a bunch Lisa....
ur initial suggestion worked !!
Thanks for confirming!
>L<
|||Hi,
I have five tables in a report which has to be repeated on every sheet of excel based on a variable
Can i also use the same condition?
Kindly help me out.
Thanks in advance
Nalini
|||"Every sheet of Excel" is basically "every explicitly-requested page of the report". By that I mean you get a sheet for each page break you explicitly asked for with a page break condition, rather than the report just deciding that it has to page break based on some constraints of the host format (for example, physical page size).
So, "Excel" shouldn't be handled specifically when trying to repeat tables -- it should work the way you want, if you get the explicit page break requests correct.
I will assume you understand this (I almost wrote "that we're on the same page" <g>) and ignore the "Excel" part of the question...
So, you want to have five tables that you want to see on each page. Can you tell me some more about your layout, what each of the tables represent from the point of view of datasets? Are they related to each other or completely distinct, data-wise? Is there additional data in the report? are the tables positioned adjacent to each other vertically, or horizontally, or what?
>L<
|||Lisa, I tried your approach and found two problems that I still can't figure out.
1) I had to do the Page break before the sections rather than after section in order for it to work.
2) I need to be able to choose the group level to page break on OR choose that no page break occurs at all. In this pursuit, I can't find a solution. Even if the Parameter!PageBreak criteria is not met, the top level group always page breaks. I need the ability to eliminate the page break as one of my options.
Any ideas?
|||Well, it definitely does work and should not require page break before -- in fact using page break before might be why you're saying "top level always breaks".
I am not on a machine where I have any of these examples, and, clearly, we need to take this from the top.
Can I have a clear(er) statement of exactly what you've done so far in this report and also a separate statement of what the requirements are? This would optimally include some simplified SELECT or other way that I can repro exactly what your group breaks look like, there may be some collision that we have to account for that wasn't in the original suggestion (or maybe the collision *can't* be accounted for in your situation -- right now I honestly have no idea).
I'm leaving for the day now, so no rush on your response <s>
>L<
|||I just created a stripped down sample report, and the issue with using page break after went away, but the other issue remains. I have a parameter named PageBreak with three option values: NONE, GROUP1, and GROUP2. When i choose NONE, it should always evaluate the Group1pre and Group2pre as ="" and therefore never cause a page break during the report. Unfortunately, it still causes the GROUP1 page breaks even if I choose NONE.
I created four group levels sequenced as follows (as seen in the Groups tab of Table Properties) and a detail row with the Detail values:
table1_Group1pre, page break at end checked, group expression =IIF(Parameters!PageBreak.Value="GROUP1",Fields!Group1.Value,"")
table1_Group1, no page breaks, group expression =Fields!Group1.Value
table1_Group2pre, page break at end checked, group expression =IIF(Parameters!PageBreak.Value="GROUP2",Fields!Group2.Value,"")
table1_Group2, no page breaks, group expression =Fields!Group2.Value
Here is the data set I created for testing.
select 'ABC' as Group1, '123' as Group2, 'slfje' as Data
union all
select 'ABC' as Group1, '123' as Group2, 'redfg' as Data
union all
select 'ABC' as Group1, '123' as Group2, 'wqsde' as Data
union all
select 'ABC' as Group1, '456' as Group2, 'rdrgd' as Data
union all
select 'ABC' as Group1, '456' as Group2, 'f5e4s6' as Data
union all
select 'ABC' as Group1, '789' as Group2, 'rhfth' as Data
union all
select 'ABC' as Group1, '789' as Group2, 'effgfg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'kuhjg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'efjklrg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'euurio' as Data
union all
select 'DEF' as Group1, '654' as Group2, 'wesdf' as Data
union all
select 'GHI' as Group1, '789' as Group2, 'yghfg' as Data
union all
select 'GHI' as Group1, '789' as Group2, '56215hh' as Data
union all
select 'GHI' as Group1, '456' as Group2, 'hbvfg' as Data
union all
select 'GHI' as Group1, '456' as Group2, 't456e4w' as Data
union all
select 'GHI' as Group1, '123' as Group2, 'ouuyf' as Data
union all
select 'GHI' as Group1, '123' as Group2, '5f4g8r9' as Data
union all
select 'GHI' as Group1, '123' as Group2, 'zzzzzzzz' as Data
Thank you for taking such care to provide a reproducible sample. I will check this out and write back, whether I can do this or not, and I have no idea at the moment <s>. I do know that it's a chancey thing, and it's often tricky to get the conditional expressions right, so I usually take a while to get it to work.
Anyway, I'll give this a shot and report back...
>L<
|||OK -- you can do this, it will work <s>. What you're missing (I think) is that you have to put the conditionals on the outer rim of the "real" groups. IOW, your group order is this:
Group1pre
Group1
Group2pre
Group2
... and it is quite possible that it would have worked something like this:
Group1pre
Group2pre
Group1
Group2
... although I didn't try it that way.
What I did try successfully, and what appears to follow the "rules of engagement" as I understand them (my understanding being without inside knowledge, just observation, and is admittedly imperfect!), is this:
GroupsPre
Group1
Group2
... using the following expression as my conditional break on GroupsPre:
Code Snippet
=IIF(Parameters!PageBreak.Value="NONE","",
IIF(Parameters!PageBreak.Value="GROUP1",
Fields!Group1.Value,
Fields!Group2.Value)
)
I want to say one other thing, based on your sample data -- which may be compounded in something you're doing in your "real" data set:
I am not sure what effect you are after on the inner group break, but you may have to dynamically sort your data to get the effect you are after when the break is on "GROUP2" (your inner group as expressed in the report). It is certainly possible to do this, of course, and I'm not even sure that is an issue for you.
[LSN Editing next morning: instead of dynamic orderng you can probably concatenate the value in the last part of the expression as csi_hugh shows in the next post]
Regards,
>L<
Conditional page breaks in SSRS
Hi,
I am having trouble setting conditional page breaks to my reports.
i.e... I am having a report where I need to allow user the option to set page break between a group or not.
Based upon the option selected by the user, I need to add page break to the report. I tried with all possibilities inside Sort and Group dialog box, but could not figure out how to toggle the option at runtime.
Does anyone know how to implement page breaks on runtime? Help me plzzzz!! I really need this to be done…Thanx in advance for any help..
- Rayz
OK, I think I have succeeded in doing this...
create a boolean parameter, something like PageBreak --I would give it a default value, but it doesn't appear to be necessary if you don't want it.
create a group with "page break at end", as you normally would. Don't put anything in its header and footer lines.
here's the trick: make this group's grouip expression an IIF() containing your "real" group expression,
something like the following example:|||
I tried it out ..but no luck for me
Wherever i apply page break..it seems it wont take the condition that i've specified..and pagebreaks appears permanently..even if i dont put pagebreak no..the page break comes..
Thanks for your suggestion
-Rayz
|||Well, let's see...
>>it seems it wont take the condition that i've specified..and pagebreaks appears permanently
What is the condition you've specified?
Also, to make sure I can repro, is this an RDL or RDLC?
>L<
|||Perhaps you should extend the syntax that Lisa has shown with the IIF() function. If you set the group expression as previously mentioned and add a field reference that is global to the report instead of the empty field ( "" ) then perhaps this evaluate correctly.
=IIF(Parameters!PageBreak.Value, Fields!MyField.Value, Fields!MyMostGlobalField.Value)
This way you will get a field reference to evaluate the grouping to. You may additionally want to hide this group with a "Visibility" expression on the group, though you may still get a page break before your report footer if one exists.
Hope this helps.
-Paul R.
|||
Hi Paul,
It actually does work fine with the "" -- and in the past I've done this with other "global/invariant" expressions -- such as True or 1. Is there some reason why this is a bad idea?
BTW another way I do this, without an IIF(), is to group on a variable and increment the variable in code when I want to force a page break -- I haven't tried that in RS and it can be a little more difficult to manage in general. So I didn't try it in response to this query. I will try it if you think it's a better idea.
Regrads,
>L<
|||Thanx a bunch Lisa....
ur initial suggestion worked !!
Thanks for confirming!
>L<
|||Hi,
I have five tables in a report which has to be repeated on every sheet of excel based on a variable
Can i also use the same condition?
Kindly help me out.
Thanks in advance
Nalini
|||"Every sheet of Excel" is basically "every explicitly-requested page of the report". By that I mean you get a sheet for each page break you explicitly asked for with a page break condition, rather than the report just deciding that it has to page break based on some constraints of the host format (for example, physical page size).
So, "Excel" shouldn't be handled specifically when trying to repeat tables -- it should work the way you want, if you get the explicit page break requests correct.
I will assume you understand this (I almost wrote "that we're on the same page" <g>) and ignore the "Excel" part of the question...
So, you want to have five tables that you want to see on each page. Can you tell me some more about your layout, what each of the tables represent from the point of view of datasets? Are they related to each other or completely distinct, data-wise? Is there additional data in the report? are the tables positioned adjacent to each other vertically, or horizontally, or what?
>L<
|||Lisa, I tried your approach and found two problems that I still can't figure out.
1) I had to do the Page break before the sections rather than after section in order for it to work.
2) I need to be able to choose the group level to page break on OR choose that no page break occurs at all. In this pursuit, I can't find a solution. Even if the Parameter!PageBreak criteria is not met, the top level group always page breaks. I need the ability to eliminate the page break as one of my options.
Any ideas?
|||Well, it definitely does work and should not require page break before -- in fact using page break before might be why you're saying "top level always breaks".
I am not on a machine where I have any of these examples, and, clearly, we need to take this from the top.
Can I have a clear(er) statement of exactly what you've done so far in this report and also a separate statement of what the requirements are? This would optimally include some simplified SELECT or other way that I can repro exactly what your group breaks look like, there may be some collision that we have to account for that wasn't in the original suggestion (or maybe the collision *can't* be accounted for in your situation -- right now I honestly have no idea).
I'm leaving for the day now, so no rush on your response <s>
>L<
|||I just created a stripped down sample report, and the issue with using page break after went away, but the other issue remains. I have a parameter named PageBreak with three option values: NONE, GROUP1, and GROUP2. When i choose NONE, it should always evaluate the Group1pre and Group2pre as ="" and therefore never cause a page break during the report. Unfortunately, it still causes the GROUP1 page breaks even if I choose NONE.
I created four group levels sequenced as follows (as seen in the Groups tab of Table Properties) and a detail row with the Detail values:
table1_Group1pre, page break at end checked, group expression =IIF(Parameters!PageBreak.Value="GROUP1",Fields!Group1.Value,"")
table1_Group1, no page breaks, group expression =Fields!Group1.Value
table1_Group2pre, page break at end checked, group expression =IIF(Parameters!PageBreak.Value="GROUP2",Fields!Group2.Value,"")
table1_Group2, no page breaks, group expression =Fields!Group2.Value
Here is the data set I created for testing.
select 'ABC' as Group1, '123' as Group2, 'slfje' as Data
union all
select 'ABC' as Group1, '123' as Group2, 'redfg' as Data
union all
select 'ABC' as Group1, '123' as Group2, 'wqsde' as Data
union all
select 'ABC' as Group1, '456' as Group2, 'rdrgd' as Data
union all
select 'ABC' as Group1, '456' as Group2, 'f5e4s6' as Data
union all
select 'ABC' as Group1, '789' as Group2, 'rhfth' as Data
union all
select 'ABC' as Group1, '789' as Group2, 'effgfg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'kuhjg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'efjklrg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'euurio' as Data
union all
select 'DEF' as Group1, '654' as Group2, 'wesdf' as Data
union all
select 'GHI' as Group1, '789' as Group2, 'yghfg' as Data
union all
select 'GHI' as Group1, '789' as Group2, '56215hh' as Data
union all
select 'GHI' as Group1, '456' as Group2, 'hbvfg' as Data
union all
select 'GHI' as Group1, '456' as Group2, 't456e4w' as Data
union all
select 'GHI' as Group1, '123' as Group2, 'ouuyf' as Data
union all
select 'GHI' as Group1, '123' as Group2, '5f4g8r9' as Data
union all
select 'GHI' as Group1, '123' as Group2, 'zzzzzzzz' as Data
Thank you for taking such care to provide a reproducible sample. I will check this out and write back, whether I can do this or not, and I have no idea at the moment <s>. I do know that it's a chancey thing, and it's often tricky to get the conditional expressions right, so I usually take a while to get it to work.
Anyway, I'll give this a shot and report back...
>L<
|||OK -- you can do this, it will work <s>. What you're missing (I think) is that you have to put the conditionals on the outer rim of the "real" groups. IOW, your group order is this:
Group1pre
Group1
Group2pre
Group2
... and it is quite possible that it would have worked something like this:
Group1pre
Group2pre
Group1
Group2
... although I didn't try it that way.
What I did try successfully, and what appears to follow the "rules of engagement" as I understand them (my understanding being without inside knowledge, just observation, and is admittedly imperfect!), is this:
GroupsPre
Group1
Group2
... using the following expression as my conditional break on GroupsPre:
Code Snippet
=IIF(Parameters!PageBreak.Value="NONE","",
IIF(Parameters!PageBreak.Value="GROUP1",
Fields!Group1.Value,
Fields!Group2.Value)
)
I want to say one other thing, based on your sample data -- which may be compounded in something you're doing in your "real" data set:
I am not sure what effect you are after on the inner group break, but you may have to dynamically sort your data to get the effect you are after when the break is on "GROUP2" (your inner group as expressed in the report). It is certainly possible to do this, of course, and I'm not even sure that is an issue for you.
[LSN Editing next morning: instead of dynamic orderng you can probably concatenate the value in the last part of the expression as csi_hugh shows in the next post]
Regards,
>L<
Conditional page breaks in SSRS
Hi,
I am having trouble setting conditional page breaks to my reports.
i.e... I am having a report where I need to allow user the option to set page break between a group or not.
Based upon the option selected by the user, I need to add page break to the report. I tried with all possibilities inside Sort and Group dialog box, but could not figure out how to toggle the option at runtime.
Does anyone know how to implement page breaks on runtime? Help me plzzzz!! I really need this to be done…Thanx in advance for any help..
- Rayz
OK, I think I have succeeded in doing this...
create a boolean parameter, something like PageBreak --I would give it a default value, but it doesn't appear to be necessary if you don't want it.
create a group with "page break at end", as you normally would. Don't put anything in its header and footer lines.
here's the trick: make this group's grouip expression an IIF() containing your "real" group expression,
something like the following example:|||
I tried it out ..but no luck for me
Wherever i apply page break..it seems it wont take the condition that i've specified..and pagebreaks appears permanently..even if i dont put pagebreak no..the page break comes..
Thanks for your suggestion
-Rayz
|||Well, let's see...
>>it seems it wont take the condition that i've specified..and pagebreaks appears permanently
What is the condition you've specified?
Also, to make sure I can repro, is this an RDL or RDLC?
>L<
|||Perhaps you should extend the syntax that Lisa has shown with the IIF() function. If you set the group expression as previously mentioned and add a field reference that is global to the report instead of the empty field ( "" ) then perhaps this evaluate correctly.
=IIF(Parameters!PageBreak.Value, Fields!MyField.Value, Fields!MyMostGlobalField.Value)
This way you will get a field reference to evaluate the grouping to. You may additionally want to hide this group with a "Visibility" expression on the group, though you may still get a page break before your report footer if one exists.
Hope this helps.
-Paul R.
|||
Hi Paul,
It actually does work fine with the "" -- and in the past I've done this with other "global/invariant" expressions -- such as True or 1. Is there some reason why this is a bad idea?
BTW another way I do this, without an IIF(), is to group on a variable and increment the variable in code when I want to force a page break -- I haven't tried that in RS and it can be a little more difficult to manage in general. So I didn't try it in response to this query. I will try it if you think it's a better idea.
Regrads,
>L<
|||Thanx a bunch Lisa....
ur initial suggestion worked !!
Thanks for confirming!
>L<
|||Hi,
I have five tables in a report which has to be repeated on every sheet of excel based on a variable
Can i also use the same condition?
Kindly help me out.
Thanks in advance
Nalini
|||"Every sheet of Excel" is basically "every explicitly-requested page of the report". By that I mean you get a sheet for each page break you explicitly asked for with a page break condition, rather than the report just deciding that it has to page break based on some constraints of the host format (for example, physical page size).
So, "Excel" shouldn't be handled specifically when trying to repeat tables -- it should work the way you want, if you get the explicit page break requests correct.
I will assume you understand this (I almost wrote "that we're on the same page" <g>) and ignore the "Excel" part of the question...
So, you want to have five tables that you want to see on each page. Can you tell me some more about your layout, what each of the tables represent from the point of view of datasets? Are they related to each other or completely distinct, data-wise? Is there additional data in the report? are the tables positioned adjacent to each other vertically, or horizontally, or what?
>L<
|||Lisa, I tried your approach and found two problems that I still can't figure out.
1) I had to do the Page break before the sections rather than after section in order for it to work.
2) I need to be able to choose the group level to page break on OR choose that no page break occurs at all. In this pursuit, I can't find a solution. Even if the Parameter!PageBreak criteria is not met, the top level group always page breaks. I need the ability to eliminate the page break as one of my options.
Any ideas?
|||Well, it definitely does work and should not require page break before -- in fact using page break before might be why you're saying "top level always breaks".
I am not on a machine where I have any of these examples, and, clearly, we need to take this from the top.
Can I have a clear(er) statement of exactly what you've done so far in this report and also a separate statement of what the requirements are? This would optimally include some simplified SELECT or other way that I can repro exactly what your group breaks look like, there may be some collision that we have to account for that wasn't in the original suggestion (or maybe the collision *can't* be accounted for in your situation -- right now I honestly have no idea).
I'm leaving for the day now, so no rush on your response <s>
>L<
|||I just created a stripped down sample report, and the issue with using page break after went away, but the other issue remains. I have a parameter named PageBreak with three option values: NONE, GROUP1, and GROUP2. When i choose NONE, it should always evaluate the Group1pre and Group2pre as ="" and therefore never cause a page break during the report. Unfortunately, it still causes the GROUP1 page breaks even if I choose NONE.
I created four group levels sequenced as follows (as seen in the Groups tab of Table Properties) and a detail row with the Detail values:
table1_Group1pre, page break at end checked, group expression =IIF(Parameters!PageBreak.Value="GROUP1",Fields!Group1.Value,"")
table1_Group1, no page breaks, group expression =Fields!Group1.Value
table1_Group2pre, page break at end checked, group expression =IIF(Parameters!PageBreak.Value="GROUP2",Fields!Group2.Value,"")
table1_Group2, no page breaks, group expression =Fields!Group2.Value
Here is the data set I created for testing.
select 'ABC' as Group1, '123' as Group2, 'slfje' as Data
union all
select 'ABC' as Group1, '123' as Group2, 'redfg' as Data
union all
select 'ABC' as Group1, '123' as Group2, 'wqsde' as Data
union all
select 'ABC' as Group1, '456' as Group2, 'rdrgd' as Data
union all
select 'ABC' as Group1, '456' as Group2, 'f5e4s6' as Data
union all
select 'ABC' as Group1, '789' as Group2, 'rhfth' as Data
union all
select 'ABC' as Group1, '789' as Group2, 'effgfg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'kuhjg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'efjklrg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'euurio' as Data
union all
select 'DEF' as Group1, '654' as Group2, 'wesdf' as Data
union all
select 'GHI' as Group1, '789' as Group2, 'yghfg' as Data
union all
select 'GHI' as Group1, '789' as Group2, '56215hh' as Data
union all
select 'GHI' as Group1, '456' as Group2, 'hbvfg' as Data
union all
select 'GHI' as Group1, '456' as Group2, 't456e4w' as Data
union all
select 'GHI' as Group1, '123' as Group2, 'ouuyf' as Data
union all
select 'GHI' as Group1, '123' as Group2, '5f4g8r9' as Data
union all
select 'GHI' as Group1, '123' as Group2, 'zzzzzzzz' as Data
Thank you for taking such care to provide a reproducible sample. I will check this out and write back, whether I can do this or not, and I have no idea at the moment <s>. I do know that it's a chancey thing, and it's often tricky to get the conditional expressions right, so I usually take a while to get it to work.
Anyway, I'll give this a shot and report back...
>L<
|||OK -- you can do this, it will work <s>. What you're missing (I think) is that you have to put the conditionals on the outer rim of the "real" groups. IOW, your group order is this:
Group1pre
Group1
Group2pre
Group2
... and it is quite possible that it would have worked something like this:
Group1pre
Group2pre
Group1
Group2
... although I didn't try it that way.
What I did try successfully, and what appears to follow the "rules of engagement" as I understand them (my understanding being without inside knowledge, just observation, and is admittedly imperfect!), is this:
GroupsPre
Group1
Group2
... using the following expression as my conditional break on GroupsPre:
Code Snippet
=IIF(Parameters!PageBreak.Value="NONE","",
IIF(Parameters!PageBreak.Value="GROUP1",
Fields!Group1.Value,
Fields!Group2.Value)
)
I want to say one other thing, based on your sample data -- which may be compounded in something you're doing in your "real" data set:
I am not sure what effect you are after on the inner group break, but you may have to dynamically sort your data to get the effect you are after when the break is on "GROUP2" (your inner group as expressed in the report). It is certainly possible to do this, of course, and I'm not even sure that is an issue for you.
[LSN Editing next morning: instead of dynamic orderng you can probably concatenate the value in the last part of the expression as csi_hugh shows in the next post]
Regards,
>L<
Conditional page breaks in SSRS
Hi,
I am having trouble setting conditional page breaks to my reports.
i.e... I am having a report where I need to allow user the option to set page break between a group or not.
Based upon the option selected by the user, I need to add page break to the report. I tried with all possibilities inside Sort and Group dialog box, but could not figure out how to toggle the option at runtime.
Does anyone know how to implement page breaks on runtime? Help me plzzzz!! I really need this to be done…Thanx in advance for any help..
- Rayz
OK, I think I have succeeded in doing this...
create a boolean parameter, something like PageBreak --I would give it a default value, but it doesn't appear to be necessary if you don't want it.
create a group with "page break at end", as you normally would. Don't put anything in its header and footer lines.
here's the trick: make this group's grouip expression an IIF() containing your "real" group expression,
something like the following example:|||
I tried it out ..but no luck for me
Wherever i apply page break..it seems it wont take the condition that i've specified..and pagebreaks appears permanently..even if i dont put pagebreak no..the page break comes..
Thanks for your suggestion
-Rayz
|||Well, let's see...
>>it seems it wont take the condition that i've specified..and pagebreaks appears permanently
What is the condition you've specified?
Also, to make sure I can repro, is this an RDL or RDLC?
>L<
|||Perhaps you should extend the syntax that Lisa has shown with the IIF() function. If you set the group expression as previously mentioned and add a field reference that is global to the report instead of the empty field ( "" ) then perhaps this evaluate correctly.
=IIF(Parameters!PageBreak.Value, Fields!MyField.Value, Fields!MyMostGlobalField.Value)
This way you will get a field reference to evaluate the grouping to. You may additionally want to hide this group with a "Visibility" expression on the group, though you may still get a page break before your report footer if one exists.
Hope this helps.
-Paul R.
|||
Hi Paul,
It actually does work fine with the "" -- and in the past I've done this with other "global/invariant" expressions -- such as True or 1. Is there some reason why this is a bad idea?
BTW another way I do this, without an IIF(), is to group on a variable and increment the variable in code when I want to force a page break -- I haven't tried that in RS and it can be a little more difficult to manage in general. So I didn't try it in response to this query. I will try it if you think it's a better idea.
Regrads,
>L<
|||Thanx a bunch Lisa....
ur initial suggestion worked !!
Thanks for confirming!
>L<
|||Hi,
I have five tables in a report which has to be repeated on every sheet of excel based on a variable
Can i also use the same condition?
Kindly help me out.
Thanks in advance
Nalini
|||"Every sheet of Excel" is basically "every explicitly-requested page of the report". By that I mean you get a sheet for each page break you explicitly asked for with a page break condition, rather than the report just deciding that it has to page break based on some constraints of the host format (for example, physical page size).
So, "Excel" shouldn't be handled specifically when trying to repeat tables -- it should work the way you want, if you get the explicit page break requests correct.
I will assume you understand this (I almost wrote "that we're on the same page" <g>) and ignore the "Excel" part of the question...
So, you want to have five tables that you want to see on each page. Can you tell me some more about your layout, what each of the tables represent from the point of view of datasets? Are they related to each other or completely distinct, data-wise? Is there additional data in the report? are the tables positioned adjacent to each other vertically, or horizontally, or what?
>L<
|||Lisa, I tried your approach and found two problems that I still can't figure out.
1) I had to do the Page break before the sections rather than after section in order for it to work.
2) I need to be able to choose the group level to page break on OR choose that no page break occurs at all. In this pursuit, I can't find a solution. Even if the Parameter!PageBreak criteria is not met, the top level group always page breaks. I need the ability to eliminate the page break as one of my options.
Any ideas?
|||Well, it definitely does work and should not require page break before -- in fact using page break before might be why you're saying "top level always breaks".
I am not on a machine where I have any of these examples, and, clearly, we need to take this from the top.
Can I have a clear(er) statement of exactly what you've done so far in this report and also a separate statement of what the requirements are? This would optimally include some simplified SELECT or other way that I can repro exactly what your group breaks look like, there may be some collision that we have to account for that wasn't in the original suggestion (or maybe the collision *can't* be accounted for in your situation -- right now I honestly have no idea).
I'm leaving for the day now, so no rush on your response <s>
>L<
|||I just created a stripped down sample report, and the issue with using page break after went away, but the other issue remains. I have a parameter named PageBreak with three option values: NONE, GROUP1, and GROUP2. When i choose NONE, it should always evaluate the Group1pre and Group2pre as ="" and therefore never cause a page break during the report. Unfortunately, it still causes the GROUP1 page breaks even if I choose NONE.
I created four group levels sequenced as follows (as seen in the Groups tab of Table Properties) and a detail row with the Detail values:
table1_Group1pre, page break at end checked, group expression =IIF(Parameters!PageBreak.Value="GROUP1",Fields!Group1.Value,"")
table1_Group1, no page breaks, group expression =Fields!Group1.Value
table1_Group2pre, page break at end checked, group expression =IIF(Parameters!PageBreak.Value="GROUP2",Fields!Group2.Value,"")
table1_Group2, no page breaks, group expression =Fields!Group2.Value
Here is the data set I created for testing.
select 'ABC' as Group1, '123' as Group2, 'slfje' as Data
union all
select 'ABC' as Group1, '123' as Group2, 'redfg' as Data
union all
select 'ABC' as Group1, '123' as Group2, 'wqsde' as Data
union all
select 'ABC' as Group1, '456' as Group2, 'rdrgd' as Data
union all
select 'ABC' as Group1, '456' as Group2, 'f5e4s6' as Data
union all
select 'ABC' as Group1, '789' as Group2, 'rhfth' as Data
union all
select 'ABC' as Group1, '789' as Group2, 'effgfg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'kuhjg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'efjklrg' as Data
union all
select 'DEF' as Group1, '987' as Group2, 'euurio' as Data
union all
select 'DEF' as Group1, '654' as Group2, 'wesdf' as Data
union all
select 'GHI' as Group1, '789' as Group2, 'yghfg' as Data
union all
select 'GHI' as Group1, '789' as Group2, '56215hh' as Data
union all
select 'GHI' as Group1, '456' as Group2, 'hbvfg' as Data
union all
select 'GHI' as Group1, '456' as Group2, 't456e4w' as Data
union all
select 'GHI' as Group1, '123' as Group2, 'ouuyf' as Data
union all
select 'GHI' as Group1, '123' as Group2, '5f4g8r9' as Data
union all
select 'GHI' as Group1, '123' as Group2, 'zzzzzzzz' as Data
Thank you for taking such care to provide a reproducible sample. I will check this out and write back, whether I can do this or not, and I have no idea at the moment <s>. I do know that it's a chancey thing, and it's often tricky to get the conditional expressions right, so I usually take a while to get it to work.
Anyway, I'll give this a shot and report back...
>L<
|||OK -- you can do this, it will work <s>. What you're missing (I think) is that you have to put the conditionals on the outer rim of the "real" groups. IOW, your group order is this:
Group1pre
Group1
Group2pre
Group2
... and it is quite possible that it would have worked something like this:
Group1pre
Group2pre
Group1
Group2
... although I didn't try it that way.
What I did try successfully, and what appears to follow the "rules of engagement" as I understand them (my understanding being without inside knowledge, just observation, and is admittedly imperfect!), is this:
GroupsPre
Group1
Group2
... using the following expression as my conditional break on GroupsPre:
Code Snippet
=IIF(Parameters!PageBreak.Value="NONE","",
IIF(Parameters!PageBreak.Value="GROUP1",
Fields!Group1.Value,
Fields!Group2.Value)
)
I want to say one other thing, based on your sample data -- which may be compounded in something you're doing in your "real" data set:
I am not sure what effect you are after on the inner group break, but you may have to dynamically sort your data to get the effect you are after when the break is on "GROUP2" (your inner group as expressed in the report). It is certainly possible to do this, of course, and I'm not even sure that is an issue for you.
[LSN Editing next morning: instead of dynamic orderng you can probably concatenate the value in the last part of the expression as csi_hugh shows in the next post]
Regards,
>L<
Conditional Page Breaks
I'm trying to generate invoice reports where there are two types of
line items (with a different number of columns). I am basically looking
to have two sets of tables as follows:
Case A - at least one of each item
Table Items 1
<PAGE BREAK>
Table Items 2
Case B - items 2 exist, but no items 1
Table Items 2
Case C - items 1 exist, but no items 2
Table Items 1
I've spent hours trying to figure out how to accomplish this - I have
played with putting Table 1 in an object with conditional visibility,
but that doesn't seem to suppress a page break. I've tried a "hidden
group" but no luck there either. I've also tried having Table items 1
in a subreport.
I'm open to suggestion if you don't think I am going about this the
right way - I would really appreciate any help!
Thanks
BNo conditional page breaks. I've been asking for them since the first
release a couple years ago. It is the main reason we have not migrated. If
you can't control the layout of the report it's pointless. I've tried many
workarounds but it seems like the developers went out of their way to not let
you programatically control them. Be it if you want to remove them as in
HTML reports or insert them manually.
Good luck on your quest. If you find something let us know.
"bigbrorpi@.gmail.com" wrote:
> Hi -
> I'm trying to generate invoice reports where there are two types of
> line items (with a different number of columns). I am basically looking
> to have two sets of tables as follows:
> Case A - at least one of each item
> Table Items 1
> <PAGE BREAK>
> Table Items 2
> Case B - items 2 exist, but no items 1
> Table Items 2
> Case C - items 1 exist, but no items 2
> Table Items 1
>
> I've spent hours trying to figure out how to accomplish this - I have
> played with putting Table 1 in an object with conditional visibility,
> but that doesn't seem to suppress a page break. I've tried a "hidden
> group" but no luck there either. I've also tried having Table items 1
> in a subreport.
> I'm open to suggestion if you don't think I am going about this the
> right way - I would really appreciate any help!
> Thanks
> B
>|||See if this can help :
You can insert a rectangle into a rectangle, and set a page break in the
inner rectangle and visibility in the outer and paste this empty nested
rectangles
in between subreports or tables . If Visible expression is True, the page
break will
work. if Visible expression is False , it will ignore a Page Break. So,
this nested construction will work as a conditional page break ( for RSS
2000) .
Wednesday, March 7, 2012
Conditional Formatting Problem when Rendering to Excel vs. PDF/HTML
Hello,
I need some quick help. I have conditional formating for color in some of the cells in my reports. When I render the reports to HTML or PDF, colors work great. When I render the report to Excel, all the cells come through in one color. How do I fix this in RS 2000? Or how do make the rendered Excel file just one specific color, like black?
Hi,
There was a similar problem with the hyperlinks used in the reports.
When HTML or I guess .pdf works fine Excel was not working as desired.
Targeting the output format that will be generally rendered by users was my solution then.
Eralper
Conditional Formatting
Does anyone know how I can have conditional formatting in my reports?
What I want to achieve is something like. If the field text = "Green" make
the background green, etc
Thanks alot in advance
Ruse the iif function for the font color. Reporting Services accepts
expressions for most of its properties.
=iif(boolean condition, "red", "black")
HTH
Charles Kangai, MCT, MCDBA
"Rudi Groenewald" wrote:
> Hi all
> Does anyone know how I can have conditional formatting in my reports?
> What I want to achieve is something like. If the field text = "Green" make
> the background green, etc
> Thanks alot in advance
> R
>
>|||Hi charles,
Thanks that worked great, just one problem,
There is 4 possibilities. it can either be red, green, yellow or blue..
I tried this:
=iif( Fields!Shift.Value = "Green", "LawnGreen", "transparent")
else
=iif( Fields!Shift.Value = "Red", "Red", "transparent")
else
=iif( Fields!Shift.Value = "Yellow", "Yellow", "transparent")
else
=iif( Fields!Shift.Value = "Blue", "Blue", "transparent")
endif
but that don't quite help it. Any ideas?
"Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
news:4C2D7CCD-E8CB-4A5C-A7D9-9E2530CABA44@.microsoft.com...
> use the iif function for the font color. Reporting Services accepts
> expressions for most of its properties.
> =iif(boolean condition, "red", "black")
> HTH
> Charles Kangai, MCT, MCDBA
> "Rudi Groenewald" wrote:
>> Hi all
>> Does anyone know how I can have conditional formatting in my reports?
>> What I want to achieve is something like. If the field text = "Green"
>> make
>> the background green, etc
>> Thanks alot in advance
>> R
>>|||IIF is a function, not a procedural statement. Therefore you cannot use the
syntax you are trying to use. Is your logic something like this: if the value
of the Shift textbox is "green", "blue", "red" or "yellow", make the color of
this the same, otherwise make it transparent? if so, you need
=iif(Fields!Shift.Value="green" or Fields!Shift.Value = "blue" or
Fields!Shift.Value = "red" or Fields!Shift.Value = "yellow",
Fields!Shift.Value, "transparent")
or are you trying to make a distinction between green and lawngreen, in
which case you could nest a second iif function like so:
=iif(Fields!Shift.Value = "blue" or Fields!Shift.Value = "red" or
Fields!Shift.Value = "yellow", Fields!Shift.Value, iif(Fields!Shift.Value ="green", "lawngreen", "transparent"))
both of the above should work.
HTH
Charles Kangai, MCT, MCDBA
"Rudi Groenewald" wrote:
> Hi charles,
> Thanks that worked great, just one problem,
> There is 4 possibilities. it can either be red, green, yellow or blue..
> I tried this:
> =iif( Fields!Shift.Value = "Green", "LawnGreen", "transparent")
> else
> =iif( Fields!Shift.Value = "Red", "Red", "transparent")
> else
> =iif( Fields!Shift.Value = "Yellow", "Yellow", "transparent")
> else
> =iif( Fields!Shift.Value = "Blue", "Blue", "transparent")
> endif
> but that don't quite help it. Any ideas?
> "Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
> news:4C2D7CCD-E8CB-4A5C-A7D9-9E2530CABA44@.microsoft.com...
> > use the iif function for the font color. Reporting Services accepts
> > expressions for most of its properties.
> >
> > =iif(boolean condition, "red", "black")
> >
> > HTH
> >
> > Charles Kangai, MCT, MCDBA
> >
> > "Rudi Groenewald" wrote:
> >
> >> Hi all
> >>
> >> Does anyone know how I can have conditional formatting in my reports?
> >>
> >> What I want to achieve is something like. If the field text = "Green"
> >> make
> >> the background green, etc
> >>
> >> Thanks alot in advance
> >>
> >> R
> >>
> >>
> >>
>
>|||Hi Charles,
I figured it out, it was kind of simple really, just had to click. The
field "shift" only displays the words "red", "blue", "green" or "yellow".
So if that is the only words which are displayed, then obviously the
expression to be used as the background is =Fields!Shift.value
but your input made me click, thanks alot
Regards
R
"Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
news:CCA10812-58FB-43BD-B8FD-4C5B2BABC5AE@.microsoft.com...
> IIF is a function, not a procedural statement. Therefore you cannot use
> the
> syntax you are trying to use. Is your logic something like this: if the
> value
> of the Shift textbox is "green", "blue", "red" or "yellow", make the color
> of
> this the same, otherwise make it transparent? if so, you need
> =iif(Fields!Shift.Value="green" or Fields!Shift.Value = "blue" or
> Fields!Shift.Value = "red" or Fields!Shift.Value = "yellow",
> Fields!Shift.Value, "transparent")
> or are you trying to make a distinction between green and lawngreen, in
> which case you could nest a second iif function like so:
> =iif(Fields!Shift.Value = "blue" or Fields!Shift.Value = "red" or
> Fields!Shift.Value = "yellow", Fields!Shift.Value, iif(Fields!Shift.Value
> => "green", "lawngreen", "transparent"))
> both of the above should work.
> HTH
> Charles Kangai, MCT, MCDBA
> "Rudi Groenewald" wrote:
>> Hi charles,
>> Thanks that worked great, just one problem,
>> There is 4 possibilities. it can either be red, green, yellow or blue..
>> I tried this:
>> =iif( Fields!Shift.Value = "Green", "LawnGreen", "transparent")
>> else
>> =iif( Fields!Shift.Value = "Red", "Red", "transparent")
>> else
>> =iif( Fields!Shift.Value = "Yellow", "Yellow", "transparent")
>> else
>> =iif( Fields!Shift.Value = "Blue", "Blue", "transparent")
>> endif
>> but that don't quite help it. Any ideas?
>> "Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in
>> message
>> news:4C2D7CCD-E8CB-4A5C-A7D9-9E2530CABA44@.microsoft.com...
>> > use the iif function for the font color. Reporting Services accepts
>> > expressions for most of its properties.
>> >
>> > =iif(boolean condition, "red", "black")
>> >
>> > HTH
>> >
>> > Charles Kangai, MCT, MCDBA
>> >
>> > "Rudi Groenewald" wrote:
>> >
>> >> Hi all
>> >>
>> >> Does anyone know how I can have conditional formatting in my reports?
>> >>
>> >> What I want to achieve is something like. If the field text = "Green"
>> >> make
>> >> the background green, etc
>> >>
>> >> Thanks alot in advance
>> >>
>> >> R
>> >>
>> >>
>> >>
>>
Saturday, February 25, 2012
Conditional drillthrough report?
different report based on the values contained in the main report?On Apr 10, 2:26 am, georges <geor...@.discussions.microsoft.com> wrote:
> Is it possible to execute conditional drillthrough reports i.e. to execute a
> different report based on the values contained in the main report?
This link might help.
http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/bba9dfc46640ab3/100ad792fec5beb6?lnk=st&q=reporting+services+conditional+drill&rnum=2#100ad792fec5beb6
Regards,
Enrique Martinez
Sr. Software Consultant
Conditional Displaying
I am using Crystal reports XI R1 . Here is the problem, I have an integer field (x), i need to display three more fields (a,b,c) based on that integer field (x) when it is maximum.
for example
when max(x) then i need to display the corresponding records of a, b, and c.
Any help would be greatly appreciated.
Thanks in advance
Sudharsan.What is the database?
I think you need to write the query
Select * from table
where x=(select max(x) from table)
and design the report using that query
Friday, February 24, 2012
Conditional color in reports?
I'd like to be able to have type color change if a value is negative.
I'd like to be able to set the entire row's color based off of group code.
Can this be done, and how?
TIAYou can write an expression for the background color of the row.
Read this for more info:
http://msdn2.microsoft.com/en-us/library/ms159238.aspx
> I have reports in Grids and Matrix formats. They look ugly!
> I'd like to be able to have type color change if a value is negative.
> I'd like to be able to set the entire row's color based off of group
> code. Can this be done, and how?
> TIA
>
Conditional -- ?
some sessions, along with "insert" etc.
Thanks,
Jim Geissman(jim_geissman@.countrywide.com) writes:
> What does "conditional" mean as a command? sp_who2 reports this for
> some sessions, along with "insert" etc.
An IF or WHILE statement. Typically with a query in the condition, like
IF EXISTS(SELECT ...). If this query is long-running, or the longest
running in a stuck loop, CONDITIONAL is likely to turn up.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks, Erland!
Erland Sommarskog wrote:
> (jim_geissman@.countrywide.com) writes:
> > What does "conditional" mean as a command? sp_who2 reports this for
> > some sessions, along with "insert" etc.
> An IF or WHILE statement. Typically with a query in the condition, like
> IF EXISTS(SELECT ...). If this query is long-running, or the longest
> running in a stuck loop, CONDITIONAL is likely to turn up.
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Friday, February 10, 2012
Concatenating Multiple Reports into One Output
We have a number of different reports (all separate RDLs). We want to allow
the users to select one or more reports to generate. Basically, we want the
user to select a number of different reports into a report group, and then
generate the entire group of reports.
First question: is it possible to generate multiple reports at the same
time?
Next question: is it possible to output all the different reports into one
long report with each individual report separated by a page break?
Thanks.Hi Oliver,
If you implement a custom multiple selection box in your user interface,
what you want is possible, I think.
Create a list box. Put the subreport field inside the list box. Set the
dataset for the list box.
Hope this helps.
Regards,
Cem Demircioglu
"Oliver" <oliver@.nospam.com> wrote in message
news:%23UaqGLvCFHA.2600@.TK2MSFTNGP09.phx.gbl...
> Hello,
> We have a number of different reports (all separate RDLs). We want to
> allow
> the users to select one or more reports to generate. Basically, we want
> the
> user to select a number of different reports into a report group, and then
> generate the entire group of reports.
> First question: is it possible to generate multiple reports at the same
> time?
> Next question: is it possible to output all the different reports into one
> long report with each individual report separated by a page break?
> Thanks.
>|||Oliver,
I think that you can do this, however it is not very pretty.
First create a "master" report. The master report will have a bunch of
subreports, one for each report the user could display. The master
report will also have a series of parameters, one for each subreport,
with the values Yes & No. In each subreport set some custom Visibility
expression like "=iif(Parameters!1stReportName.Value = "Yes", true,
false)" This will display the subreport based on the value of the
parameter.
If you put each subreport in a separate group of a table, you can force
a page break at the end.
hopefully this will give you some ideas