Solved

Cognos - Results of a Query object into an HTML object

Posted on 2011-02-18
10
1,617 Views
Last Modified: 2012-05-11
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>
0
Comment
Question by:JustinW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 8

Expert Comment

by:SNeupane
ID: 34926877
Select HTML item and in the properties under HTML Source, change Source type to 'Report Expression'.
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.
0
 
LVL 1

Author Comment

by:JustinW
ID: 34927296
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>
0
 
LVL 8

Accepted Solution

by:
SNeupane earned 500 total points
ID: 34927447
Okay, to make that work, follow the same instructiton I gave before and use single quotes to wrap HTML tags so that Cognos thinks it is a text.
I tested it in Cognos 8 and works fine.
Notice the single quote from '<html to h1>' and also from '</h1 to </html>'
'<html>
   <body>
      <h1>' + [SQL1].[ASSET_MGR]
+ '</h1>
   </body>  
</html>'
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 1

Author Comment

by:JustinW
ID: 34927553
Super dumb question;
the HTML goes in the Expression Definition?

Its not working for me
0
 
LVL 1

Author Comment

by:JustinW
ID: 34927587
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
0
 
LVL 8

Expert Comment

by:SNeupane
ID: 34928056
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.
0
 
LVL 8

Expert Comment

by:SNeupane
ID: 34928109
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
0
 
LVL 8

Expert Comment

by:SNeupane
ID: 34928141
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.
0
 
LVL 1

Author Closing Comment

by:JustinW
ID: 34928251
Perfect!
THanks a tonne!
0
 
LVL 8

Expert Comment

by:SNeupane
ID: 34928313
You are welcome.
:)
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question