JustinW
asked on
Cognos - Results of a Query object into an HTML object
Is there any way in Cognos Report Builder 8.+
to use the results of a query object in an html object.
For example, say I have a query that returns 1 record containing
-Asset Name
-Property Name
-Property State
-Property City
I want to have an HTML object where I can use these results like
<html>
<body>
<h1>ASSET</h1><br />
<p><%=Asset_Name%></p>
<p><%=Property_Name%></p>
<p><%=etc%></p>
</body>
<html>
to use the results of a query object in an html object.
For example, say I have a query that returns 1 record containing
-Asset Name
-Property Name
-Property State
-Property City
I want to have an HTML object where I can use these results like
<html>
<body>
<h1>ASSET</h1><br />
<p><%=Asset_Name%></p>
<p><%=Property_Name%></p>
<p><%=etc%></p>
</body>
<html>
ASKER
thanks,
so if I want to do the following; how would I go about doing it?
<html>
<body>
<h1>
[SQL1].[ASSET_MGR]
</h1>
</body>
</html>
so if I want to do the following; how would I go about doing it?
<html>
<body>
<h1>
[SQL1].[ASSET_MGR]
</h1>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Super dumb question;
the HTML goes in the Expression Definition?
Its not working for me
the HTML goes in the Expression Definition?
Its not working for me
ASKER
Sorry, that's pretty vague;
It throws this error with, or without the HTML
RSV-VAL-0002 Invalid Expression [Query1].[ASSET_MGR]. CRX-API-0005...The variable named '[Query1].[ASSET_MGR]' is invalid
It throws this error with, or without the HTML
RSV-VAL-0002 Invalid Expression [Query1].[ASSET_MGR]. CRX-API-0005...The variable named '[Query1].[ASSET_MGR]' is invalid
That's a different error.
Select the page and associate the query with those data items checked.
It'll not give that error after that.
Select the page and associate the query with those data items checked.
It'll not give that error after that.
In order to use a variable or data item directly on a page, you have to associate the query.
Click on the page, go to properties, select page.
Click on query and select the query that you are using on the HTML item.
Then check the data items used and click okay.
To clarify more check the attached image.
variable.JPG
Click on the page, go to properties, select page.
Click on query and select the query that you are using on the HTML item.
Then check the data items used and click okay.
To clarify more check the attached image.
variable.JPG
Not sure if you were able to follow.
The HTML item should have the property of 'HTML Source' --> 'Source Type' set to report expression.
Then you use the single quote method I gave.
Then apply the query in the page as above and you should be all set.
I've tested it and done it before. Works fine.
The HTML item should have the property of 'HTML Source' --> 'Source Type' set to report expression.
Then you use the single quote method I gave.
Then apply the query in the page as above and you should be all set.
I've tested it and done it before. Works fine.
ASKER
Perfect!
THanks a tonne!
THanks a tonne!
You are welcome.
:)
:)
Then you can use one of the data item in that HTML directly.
Just add separate HTML item for each query and format it to look like what you want.
In report expression, you can concatenate characters.