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

How to show error message while load is in progress

Started by Ludijak, 16 Feb 2021 09:35:26 AM

Previous topic - Next topic

Ludijak

Hi,

what I want is that when user runs report while load is in progress that he just get message "Load is in progress" instead of real report. What I have is table which have value 1 when load is in progress and 0 else. I created boolean variable based on those values and wanted to create conditional split on report so when load is in progress user would get page with that message, but I couldn't make that to work.

If you have any thoughts on how to make this I would be grateful. :)

MFGF

Quote from: Ludijak on 16 Feb 2021 09:35:26 AM
Hi,

what I want is that when user runs report while load is in progress that he just get message "Load is in progress" instead of real report. What I have is table which have value 1 when load is in progress and 0 else. I created boolean variable based on those values and wanted to create conditional split on report so when load is in progress user would get page with that message, but I couldn't make that to work.

If you have any thoughts on how to make this I would be grateful. :)

Hi,

Can you elaborate on exactly what you tried, and what "couldn't make that to work" means (eg, error message, wrong result, no result, something else)?
Is the table with the loading flag part of your package/data module? Is it joined? Is caching disabled? It's impossible to advise on how to proceed unless we know more about how things are set up and what you've already tried, sorry.

Cheers!

MF.
Meep!

Ludijak

#2
Quote from: MFGF on 16 Feb 2021 01:07:33 PM
Hi,

Can you elaborate on exactly what you tried, and what "couldn't make that to work" means (eg, error message, wrong result, no result, something else)?
Is the table with the loading flag part of your package/data module? Is it joined? Is caching disabled? It's impossible to advise on how to proceed unless we know more about how things are set up and what you've already tried, sorry.

Cheers!

MF.

I'll try to explain better. Table is part of my data module, caching is disabled. I created conditional layout with that variable on my model, but when I tried to run it I always got error message "The conditional layout expression is not valid."

Today I got idea for another approach, instead of boolean variable and conditional layout I created string variable and 2nd page on my report where I put wanted message. Then I put rendering variable on both pages, one real and another for load in progress. Now when I run report real page is not rendered when it is not supposed to be, but I don't get 2nd page with message to show.

I hope I explained this better now, if you have any more questions I'll try my best to answer.

MFGF

Quote from: Ludijak on 17 Feb 2021 01:51:31 AM
I'll try to explain better. Table is part of my data module, caching is disabled. I created conditional layout with that variable on my model, but when I tried to run it I always got error message "The conditional layout expression is not valid."

Today I got idea for another approach, instead of boolean variable and conditional layout I created string variable and 2nd page on my report where I put wanted message. Then I put rendering variable on both pages, one real and another for load in progress. Now when I run report real page is not rendered when it is not supposed to be, but I don't get 2nd page with message to show.

I hope I explained this better now, if you have any more questions I'll try my best to answer.

Hi,

The message "The conditional layout expression is not valid" means the report is having trouble with the syntax of the expression you are using. Did it validate successfully in the expression editor? What was the expression?

Cheers!

MF.
Meep!

Ludijak

#4
Quote from: MFGF on 17 Feb 2021 07:26:33 AM
Hi,

The message "The conditional layout expression is not valid" means the report is having trouble with the syntax of the expression you are using. Did it validate successfully in the expression editor? What was the expression?

Cheers!

MF.

I decided to go with another approach. I've created conditional variable like this:
"Case when Report = 'A' and Load = 1 then 'Yes' else 'No' end"
where values are from table looking like this:





ReportLoad
A1
B0

Then I created to pages, set render variable 'Yes' on "Error page" and 'No' on real report page.

I don't get any errors but it doesn't work as expected. It will return "Error page" wether it's 0 or 1 in table.

Hope this explains my problem better.

PS. I did try with two boolean variables, one for case 1 other for 0 with each on it's corresponding page but that didn't get me there either.


MFGF

Quote from: Ludijak on 17 Feb 2021 09:26:00 AM
I decided to go with another approach. I've created conditional variable like this:
"Case when Report = 'A' and Load = 1 then 'Yes' else 'No' end"
where values are from table looking like this:





ReportLoad
A1
B0

Then I created to pages, set render variable 'Yes' on "Error page" and 'No' on real report page.

I don't get any errors but it doesn't work as expected. It will return "Error page" wether it's 0 or 1 in table.

Hope this explains my problem better.

PS. I did try with two boolean variables, one for case 1 other for 0 with each on it's corresponding page but that didn't get me there either.

Hi,

I assume you have brought both items (Report and Load) into a query in the report? Then added the query as a property of each page? Also checked both items in the Properties property of the pages?
If your table contains two rows (which I'm assuming it does from what you posted), have you also filtered your query to just bring in the row for Report A?

I just tried something simpler here (with a single page and a conditional block) and it works for me. Start with your report page authored as you wish it to be. Then:

1. Bring in a Conditional Block.
2. Add a new query to the report and bring in both the Report and Load items from your table into the query. Add a detail filter [Report] = 'A'
3. Go to the properties of your page and add the query to the Query property. In the Properties property check both items in the query.
4. In the properties of your Conditional Block go to the Block Variable property and add a new boolean variable. For the expression use [Yourquery].[Report] = 'A' and [Yourquery].[Load] = 1 (also note that checking Report = A is redundant since we already filtered the query to only bring in the row for A so you can omit this part of the expression if you prefer).
5. In the properties of your Conditional Block, set the Current Block property to 'No' and then drag in the report content from your page into the conditional block.
6. In the properties of your Conditional Block, set the Current Block property to 'Yes' and add a text item into the conditional block "Load is in progress".

This works as expected for me. I see the normal report output when Load is set to 0, and I see the text message when Load is set to 1.

Cheers!

MF.
Meep!

Ludijak

Quote from: MFGF on 17 Feb 2021 10:18:55 AM
Hi,

I assume you have brought both items (Report and Load) into a query in the report? Then added the query as a property of each page? Also checked both items in the Properties property of the pages?
If your table contains two rows (which I'm assuming it does from what you posted), have you also filtered your query to just bring in the row for Report A?


Did all of above but somehow when importing data table from FM I accidentally put Load value as count so it was always 1 in conditional variable. It took me a while to figure out where the problem was, but it is working now and that is whats important.

Thank you for you help. :)