Friday, March 30, 2012
Immediate Help Needed Please!
This is a repost from last Friday
Has anyone used the "Jump to Report" to pull up any one report from a
selection of 7 other sub-reports.
I am trying to pull up a specific detail report from 7 sub-reports using an
individual pin # and the "report type" from the main report.
These sub-report types are grouped from type 1 thru 7. I have used the the
"IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
Box Properties) but neither of the statements worked for me. Any help?
Below is my case Statement...
CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType = 7 THEN Seventh Report .rdl') ENDWhat is the jump to producing now? Is it jumping to any report? Are you
getting an error message?
"Ben Cole" wrote:
> Hi All,
> This is a repost from last Friday
> Has anyone used the "Jump to Report" to pull up any one report from a
> selection of 7 other sub-reports.
> I am trying to pull up a specific detail report from 7 sub-reports using an
> individual pin # and the "report type" from the main report.
> These sub-report types are grouped from type 1 thru 7. I have used the the
> "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> Box Properties) but neither of the statements worked for me. Any help?
> Below is my case Statement...
>
> CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => 7 THEN Seventh Report .rdl') END
>|||Daw,
The error msge I'm getting is: "Report can not be compiled. Verify the
report name and that the report is in the current project."
I made sure the report names are all in the current project and are viewable.
Thx
"daw" wrote:
> What is the jump to producing now? Is it jumping to any report? Are you
> getting an error message?
> "Ben Cole" wrote:
> > Hi All,
> > This is a repost from last Friday
> >
> > Has anyone used the "Jump to Report" to pull up any one report from a
> > selection of 7 other sub-reports.
> > I am trying to pull up a specific detail report from 7 sub-reports using an
> > individual pin # and the "report type" from the main report.
> >
> > These sub-report types are grouped from type 1 thru 7. I have used the the
> > "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> > Box Properties) but neither of the statements worked for me. Any help?
> > Below is my case Statement...
> >
> >
> >
> > CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> > THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> > ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> > Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => > 7 THEN Seventh Report .rdl') END
> >|||I tested it with iif and got it to work with the following format:
=iif( Fields!MyField.Value ="MyValue", "Report 1", "Report 2")
I don't think that you can use CASE in the Edit Expression window. This
example assumes that your reports are in the same project. You don't need
.rdl at the end of the names - I grabbed the report names by expanding
Constants in the Edit Expression window.
Hope that helps!
"Ben Cole" wrote:
> Hi All,
> This is a repost from last Friday
> Has anyone used the "Jump to Report" to pull up any one report from a
> selection of 7 other sub-reports.
> I am trying to pull up a specific detail report from 7 sub-reports using an
> individual pin # and the "report type" from the main report.
> These sub-report types are grouped from type 1 thru 7. I have used the the
> "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> Box Properties) but neither of the statements worked for me. Any help?
> Below is my case Statement...
>
> CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => 7 THEN Seventh Report .rdl') END
>|||Thx daw for your help... I did try your example and still got the same error
msge.
I hope I'm not asking for too much here?
I was wondering if you can convert my CASE statement below with IIF
statement so I see what it actually looks like
thx for all your help!!
"daw" wrote:
> I tested it with iif and got it to work with the following format:
> =iif( Fields!MyField.Value ="MyValue", "Report 1", "Report 2")
> I don't think that you can use CASE in the Edit Expression window. This
> example assumes that your reports are in the same project. You don't need
> .rdl at the end of the names - I grabbed the report names by expanding
> Constants in the Edit Expression window.
> Hope that helps!
> "Ben Cole" wrote:
> > Hi All,
> > This is a repost from last Friday
> >
> > Has anyone used the "Jump to Report" to pull up any one report from a
> > selection of 7 other sub-reports.
> > I am trying to pull up a specific detail report from 7 sub-reports using an
> > individual pin # and the "report type" from the main report.
> >
> > These sub-report types are grouped from type 1 thru 7. I have used the the
> > "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> > Box Properties) but neither of the statements worked for me. Any help?
> > Below is my case Statement...
> >
> >
> >
> > CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> > THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> > ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> > Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => > 7 THEN Seventh Report .rdl') END
> >|||Try this:
=iif(Fields!ReportType.Value =1, "First Report",iif(Fields!ReportType.Value
=2, "Second Report",iif(Fields!ReportType.Value =3, "Third Report",
iif(Fields!ReportType.Value =4,"Fourth Report" ,iif(Fields!ReportType.Value
=5, "Fifth Report", iif(Fields!ReportType.Value =6,"Sixth Report","Seventh
Report"))))))
This statement assumes that if the ReportType value is not 1 through 6, that
it is 7 and will jump to the seventh report. Good luck!
"Ben Cole" wrote:
> Thx daw for your help... I did try your example and still got the same error
> msge.
> I hope I'm not asking for too much here?
> I was wondering if you can convert my CASE statement below with IIF
> statement so I see what it actually looks like
> thx for all your help!!
> "daw" wrote:
> > I tested it with iif and got it to work with the following format:
> >
> > =iif( Fields!MyField.Value ="MyValue", "Report 1", "Report 2")
> >
> > I don't think that you can use CASE in the Edit Expression window. This
> > example assumes that your reports are in the same project. You don't need
> > .rdl at the end of the names - I grabbed the report names by expanding
> > Constants in the Edit Expression window.
> >
> > Hope that helps!
> >
> > "Ben Cole" wrote:
> >
> > > Hi All,
> > > This is a repost from last Friday
> > >
> > > Has anyone used the "Jump to Report" to pull up any one report from a
> > > selection of 7 other sub-reports.
> > > I am trying to pull up a specific detail report from 7 sub-reports using an
> > > individual pin # and the "report type" from the main report.
> > >
> > > These sub-report types are grouped from type 1 thru 7. I have used the the
> > > "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> > > Box Properties) but neither of the statements worked for me. Any help?
> > > Below is my case Statement...
> > >
> > >
> > >
> > > CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> > > THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> > > ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> > > Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => > > 7 THEN Seventh Report .rdl') END
> > >|||A BIG Thx to you, daw!!! I finally got it to work!!
Thx again!
"daw" wrote:
> Try this:
> =iif(Fields!ReportType.Value =1, "First Report",iif(Fields!ReportType.Value
> =2, "Second Report",iif(Fields!ReportType.Value =3, "Third Report",
> iif(Fields!ReportType.Value =4,"Fourth Report" ,iif(Fields!ReportType.Value
> =5, "Fifth Report", iif(Fields!ReportType.Value =6,"Sixth Report","Seventh
> Report"))))))
> This statement assumes that if the ReportType value is not 1 through 6, that
> it is 7 and will jump to the seventh report. Good luck!
> "Ben Cole" wrote:
> > Thx daw for your help... I did try your example and still got the same error
> > msge.
> >
> > I hope I'm not asking for too much here?
> > I was wondering if you can convert my CASE statement below with IIF
> > statement so I see what it actually looks like
> > thx for all your help!!
> >
> > "daw" wrote:
> >
> > > I tested it with iif and got it to work with the following format:
> > >
> > > =iif( Fields!MyField.Value ="MyValue", "Report 1", "Report 2")
> > >
> > > I don't think that you can use CASE in the Edit Expression window. This
> > > example assumes that your reports are in the same project. You don't need
> > > .rdl at the end of the names - I grabbed the report names by expanding
> > > Constants in the Edit Expression window.
> > >
> > > Hope that helps!
> > >
> > > "Ben Cole" wrote:
> > >
> > > > Hi All,
> > > > This is a repost from last Friday
> > > >
> > > > Has anyone used the "Jump to Report" to pull up any one report from a
> > > > selection of 7 other sub-reports.
> > > > I am trying to pull up a specific detail report from 7 sub-reports using an
> > > > individual pin # and the "report type" from the main report.
> > > >
> > > > These sub-report types are grouped from type 1 thru 7. I have used the the
> > > > "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> > > > Box Properties) but neither of the statements worked for me. Any help?
> > > > Below is my case Statement...
> > > >
> > > >
> > > >
> > > > CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> > > > THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> > > > ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> > > > Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => > > > 7 THEN Seventh Report .rdl') END
> > > >
Sunday, February 19, 2012
IIF and multi-valued parameters
Hi
i have a report that can show upto 8 charts, dependant on the selection(s) made in a multi-valued parameter.
basically, the report gets loads of data back from DataCube.
if the user has selected (for example) 2 categories in the multi-valued parameter (e.g. "beverages" & "confectionary") , the the first chart will show the results filtered for "beverages" and the second chart will show the results for the "confectionary" category.
but
i want to hide any charts that are not used - i.e. the user only selects 3 categories, i want to show 3 and hide 5 charts and am trying to do this with IIF in the FILTER properties of the chart
so for each chart, i am checking to see if a Category selection has been made for that chart - and if it has, filter the results and display the chart. if no selection has been made, then filter the results for "XXXXX" (no data with this category)
am doing this by trying to get the selected value or "xxxxx" if noting selected
to hide the second chart when only one category has been selected, tried
e.g. for the third chart
=iif(
Parameters!LOOKUPITEMCategoryDescription.count>2,
Parameters!LOOKUPITEMCategoryDescription.Label(2),
"xxxxx")
doesnt work - gives an #Error as a reult
But it works fine when there are > 2 categories selected
also
this works fine when there is 2 or >2 category selected
=iif(
Parameters!LOOKUPITEMCategoryDescription.count>2,
"more than 2",
"not more than 2")
it would appear that IIF is trying to evaluate the TRUE condition(Parameters!HydraCORELOOKUPITEMCategoryDescription.Label(2)) even though the condition is false !!!
help please
thx
IIf evaluates everything in the expression and does not employ shortcutting. This means the expression Parameters!LOOKUPITEMCategoryDescription.Label(2) will cause a problem if there are less than two items selected, because it is evaluated regardless. This means that you will need to change the way you check if a parameter option has been selected, maybe by doing an InStr() on Parameters!LOOKUPITEMCategoryDescription, or by calling a function with the parameter and looping safely through it in the function.
Also, i would think it is better to hide you chart with an expression in the Visibility|Hidden property rather than trying to use the Filters property.
|||You have to use your report code to achieve this. Have a global variable of type object array in your code and write a function in the code which will receive an object array and store it in the global variable. Then have an invisible textbox at the top of your report and call this function from the textbox expression like Code.YourFunction(Parameters!LOOKUPITEMCategoryDescription.Value).
Then write another function in the code which will receive the index and check if the count of the items in the object array is greater than the received index and return the appropriate item from the object array. Call this function in your Filter expression of the chart.
If you need example about how to do it, please let me know.
Shyam
|||sluugy & Shyam
thx for this - should have posted an answer as i had already realised about vb evaluating the whole expression in IIF and written the function as described
thx
m