If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Error while case statement

Started by anwar_pat, 28 Jun 2007 08:46:27 PM

Previous topic - Next topic

anwar_pat

Hi All,
i am getting following error while using case block.

Case
When [p_choice]=1 then ‘Page1’
When [p_choice]=2 then ‘Page2’
When [p_choice]=3 then ‘Page3’
When [p_choice]=4 then ‘Page4’
ELSE 'Page5'
End

p_choice is parameter of prompt and this case statment is expression of one string variable.

i am getting following error.

Parsing error on or around position 37 in the expression : "Case

When [p_choice]=1 then ‘Page1’
When [p_choice]=2 then ‘Page2’
When [p_choice]=3 then ‘Page3’
When [p_choice]=4 then ‘Page4’
ELSE 'Page5'
End
*

can anyone help me where i am doing wrong.

thanks n advance

ajax6262

Try this:

Case [p_choice]
When 1 then ‘Page1’
When 2 then ‘Page2’
When 3 then ‘Page3’
When 4 then ‘Page4’
ELSE 'Page5'
End

Desperado

Try this:

Case [p_choice]
When '1' then ‘Page1’
When '2' then ‘Page2’
When '3' then ‘Page3’
When '4' then ‘Page4’
ELSE 'Page5'
End


or this


Case
When [p_choice]='1' then ‘Page1’
When [p_choice]='2' then ‘Page2’
When [p_choice]='3' then ‘Page3’
When [p_choice]='4' then ‘Page4’
ELSE 'Page5'
End


and please let me know if it works .

anwar_pat

thankx for your reply.was found the problem.actually if you look the single quote was not proper.

again thz.now i have one problem.i have 5 pages of reports and want to put in portal,so it wil open in HTML.now the thing is i want to put kind of prompt on the corner so that user can navigate any page of report i mean if user select page3 thn it should show page 3 and again if user want page5 thn it shud show page5....

do u hav any idea how wil achive this.coz i want prompt in all pages of reports.

thanks n advance.

larsonr

Several options you can explore.  One is have the prompt re-run the report using the prompt as a render variable for which page appears or you could write a tabbed version of the report, with each of the five pages representing a tab on main page.  The prompt to render variable needs to alter a query that is assigned to each of the five pages.  The tabbed version is documented on the support website.

anwar_pat

thnz for reply..can u explain how i shud get using prompt re-run the report using as the render variable.Actually what i have done so far.i have created one string variable and put the value 1 for Page 1 2 for Page 2 and so on....the expression i have case statement to select a particular page based on paramdisplayvalue('Parameter1').
Added one value prompt and set the static choices for each values..i mean 1 for Page 1 2 for page 2...and i set auto submit properties for value prompt.
now i have set each page render value with corresponding values except first page.coz first page is default.Now wht happening i am able to see prompt on first page but when i changed to Page 2 its referesing but again showing first page only...i dnt knw whr i m doing mistake.
can u hlep me.

thanx n advance.


larsonr

This is my fault for that suggestion.  I forget we tried the prompting option a few months back but it was causing a re-run of the report when hitting different pages.  We actually put the data from the report pages in a conditional block. 

In this case you have five pages you want to conditionally show up.  You will need to put it into one page.

Then you will need to create a conditional block with five different variables to select on.  Each variable renders that set of data in the block corresponding to one of your original five pages.   This will work with a re-prompt. 

For help with Conditional Blocks, I would refer to the report studio userguide.

Sorry that what I stated before was misleading but I guarantee this solution works as this is how we created a "mini-query studio" type report for users to pick different data sets.

DSR

HI

Try it Once It will work correctly

1. take as many pages you want and at the starting of each page take one block.

2. Take a Prompt Page ,In that drop 1 value prompt and Click finish

3. Go to 'Conditional Explorer' and drag 1 String variable and in 'Available Components' you find one Parameter1 drag that.

4.Add values like if you have 1.....10 pages then u need to add 1,2,3,...10

5.Now select page 1 and select total page then apply rendar variable and check only 1

6. Then select page2 and select total page then apply rendar variable and check only 2

7. Repeate 5 and 6  up to the number of pages u have.

8. Go to prompt page and click on value prompt , Go to Properties of value prompt then select ststic choice select varibale and  select 1 in values drop down list and

  Use:1
Display:page 1

9. Repeate step 8 up to how many pages u have.

10. Go to Prompt page and click on value prompt and copy it

11.go to page1 and click on block and paste

12.repeate step 11 up to how many pages u have.

I hope this is the requirement for ur question,If u need more information post ur question


Thanks

Sanjeev