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

"Metadata not Available" After Saving New Template

Started by raywilliams, 29 Jan 2015 08:32:04 AM

Previous topic - Next topic

raywilliams

I'm having a strange issue relating to a new report template I created. It was very simple to create the template, then add it to Cognos following these instructions http://www.brightstarpartners.com/techcorner/Techniques/Sep2011technique2.php. Now, though, I'm seeing a message that says "Metadata not available" in the Source panel. To better explain, I'll walk you through the steps that I take:


  • From the Cognos Welcome page, I click on "Author advanced reports" to take me to Report Studio.
  • A window pops up and I select which package to use.
  • I'm then taken to what I consider a splash screen for Report Studio, and I click on the "Create new" button.
  • A small window opens, I choose my new template, and I click OK.
  • My report template opens, but the Source panel is empty except for the message "Metadata not available".

I don't know how to fix that issue...

Here's something else that's strange. If I open Report Studio, create something else new first say like a list report, the Source panel populates as normal. If I THEN click on the new report button to open my template, the Source panel stays populated. So the only way I can get it to behave normally is to open a different new report first.

Does anyone know about templates and the wrong turn I've taken somewhere? If you need more information I'd be happy to give more details.

MFGF

Quote from: raywilliams on 29 Jan 2015 08:32:04 AM
I'm having a strange issue relating to a new report template I created. It was very simple to create the template, then add it to Cognos following these instructions http://www.brightstarpartners.com/techcorner/Techniques/Sep2011technique2.php. Now, though, I'm seeing a message that says "Metadata not available" in the Source panel. To better explain, I'll walk you through the steps that I take:


  • From the Cognos Welcome page, I click on "Author advanced reports" to take me to Report Studio.
  • A window pops up and I select which package to use.
  • I'm then taken to what I consider a splash screen for Report Studio, and I click on the "Create new" button.
  • A small window opens, I choose my new template, and I click OK.
  • My report template opens, but the Source panel is empty except for the message "Metadata not available".

I don't know how to fix that issue...

Here's something else that's strange. If I open Report Studio, create something else new first say like a list report, the Source panel populates as normal. If I THEN click on the new report button to open my template, the Source panel stays populated. So the only way I can get it to behave normally is to open a different new report first.

Does anyone know about templates and the wrong turn I've taken somewhere? If you need more information I'd be happy to give more details.

It sounds to me like you have a syntax error in either templates.xml or resources.xml. Hopefully you took copies of the originals before you edited them. I would try putting the originals back (and making sure things return to normal) then make the changes again, being very careful to follow the instructions exactly.

If it doesn't work after this, you're going to need to post up the changes you made so we can try to spot the issue.

MF.
Meep!

raywilliams


raywilliams

After ooking over Resources.xml, that file seems okay. I think the issue may be with templates.xml. I'll post two snippets of code comparing my template with an existing one and then ask a question or two.

Existing List Template
<template name="List">
<report useStyleVersion="10" expressionLocale="en-us">
<modelPath/>
<drillBehavior modelBasedDrillThru="true"/>
<queries>
<query name="">
<source>
<model/>
</source>
<selection/>
</query>
</queries>
<layouts>


New List Template
<template name="New List">
<report useStyleVersion="10" expressionLocale="en-us">
<drillBehavior/>
<layouts>


Now, it's rather obvious that the new list template is missing the modelPath and queries tags. The question I have is whether or not that's actually the problem. Are those tags necessary to make it function correctly? If that's an obvious question, please don't roll your eyes too hard!  ::)  I'm tasked with making Cognos templates that look a certain way, but I don't know much about the functionality of Cognos. I'm learning as I go!

MFGF

Quote from: raywilliams on 29 Jan 2015 11:27:02 AM
After ooking over Resources.xml, that file seems okay. I think the issue may be with templates.xml. I'll post two snippets of code comparing my template with an existing one and then ask a question or two.

Existing List Template
<template name="List">
<report useStyleVersion="10" expressionLocale="en-us">
<modelPath/>
<drillBehavior modelBasedDrillThru="true"/>
<queries>
<query name="">
<source>
<model/>
</source>
<selection/>
</query>
</queries>
<layouts>


New List Template
<template name="New List">
<report useStyleVersion="10" expressionLocale="en-us">
<drillBehavior/>
<layouts>


Now, it's rather obvious that the new list template is missing the modelPath and queries tags. The question I have is whether or not that's actually the problem. Are those tags necessary to make it function correctly? If that's an obvious question, please don't roll your eyes too hard!  ::)  I'm tasked with making Cognos templates that look a certain way, but I don't know much about the functionality of Cognos. I'm learning as I go!

I always find the best option for getting a working template is to use an existing template as, er, a template (within templates.xml) :) If you want a variation of a list report, for example, copy and rename the existing list report xml  within templates.xml and add/modify the appropriate parts of it by substituting xml from the report template you created in Report Studio. You can get the XML for this by going to Tools > Copy Report to Clipboard in Report Studio. I suspect your issue here is the lack of modelPath. If your new template is also for a list report, you will probably need an empty query in it by default, too, so the lack of the queries tag will also cause you an issue :)

Cheers!

MF.
Meep!

raywilliams

MF, thanks so much for your guidance! I took your advice and began modeling my new template after the existing list template in templates.xml. I remember following the instructions and originally copying the report to clipboard in Report Studio and blindly pasting it into place in templates.xml. A lesson learned here is DON'T DO THAT! I fixed the metadata issue, but my now I'm seeing that an HTML Item with some CSS is being removed. It's the last item in the report body (not header or footer). Thoughts on why that would happen? Malformed XML again?

raywilliams

I've still not figured out why the CSS in the HTML Item isn't showing up. I'm going to post the entire new template below, so apologies for such a long piece of XML to look at and have to scroll through. Would anyone mind looking over the XML to see if I'm missing an obvious mistake?

<template name="New List">
<report useStyleVersion="10" expressionLocale="en-us">
<modelPath/>
<drillBehavior modelBasedDrillThru="true"/>
<queries>
<query name="">
<source>
<model/>
</source>
<selection/>
</query>
</queries>
<layouts>
<layout>
<reportPages>
<page>
<style>
<defaultStyles>
<defaultStyle refStyle="pg"/>
</defaultStyles>
<CSS value="border-collapse: collapse;"/>
</style>
<pageBody>
<style>
<defaultStyles>
<defaultStyle refStyle="pb"/>
</defaultStyles>
</style>
<contents>
<list refQuery="" horizontalPagination="true">
<listColumnTitleStyle/>
<listColumnBodyStyle/>
<listColumnStyle/>
<noDataHandler>
<contents>
<block>
<contents>
<textItem>
<dataSource>
<staticValue>
<stringRes id="IDS_LBL_NO_DATA_AVAILABLE"/>
</staticValue>
</dataSource>
<style>
<CSS value="padding:10px 18px;"/>
</style>
</textItem>
</contents>
</block>
</contents>
</noDataHandler>
<style>
<defaultStyles>
<defaultStyle refStyle="ls"/>
</defaultStyles>
<CSS value="border-collapse:collapse"/>
</style>
</list>
</contents>
</pageBody>
<pageHeader>
<contents>
<table>
<style>
<defaultStyles>
<defaultStyle refStyle="tb"/>
</defaultStyles>
<CSS value="border-collapse:collapse;width:100%"/>
</style>
<tableRows>
<tableRow>
<tableCells>
<tableCell>
<contents>
<textItem>
<dataSource>
<staticValue>Title Text</staticValue>
</dataSource>
<style>
<defaultStyles>
<defaultStyle refStyle="u_h1"/>
</defaultStyles>
</style>
</textItem>
</contents>
<style>
<defaultStyles>
<defaultStyle refStyle="u_h1"/>
</defaultStyles>
</style>
</tableCell>
</tableCells>
</tableRow>
</tableRows>
</table>
</contents>
</pageHeader>
<pageFooter>
<contents>
<table>
<tableRows>
<tableRow>
<tableCells>
<tableCell>
<contents>
<textItem>
<dataSource>
<staticValue>Powered by  </staticValue>
</dataSource>
<style>
<defaultStyles>
<defaultStyle refStyle="u_footer"/>
</defaultStyles>
</style>
</textItem>
<textItem>
<dataSource>
<staticValue>NAME HERE</staticValue>
</dataSource>
<style>
<defaultStyles>
<defaultStyle refStyle="u_footertitle"/>
</defaultStyles>
</style>
</textItem>
</contents>
<style>
<CSS value="vertical-align:top;text-align:left;width:40%"/>
</style>
</tableCell>
<tableCell>
<contents>
<date>
<style>
<dataFormat>
<dateFormat/>
</dataFormat>
<defaultStyles>
<defaultStyle refStyle="u_footer"/>
</defaultStyles>
</style>
</date>
</contents>
<style>
<CSS value="vertical-align:top;text-align:center;width:20%"/>
</style>
</tableCell>
<tableCell>
<contents>
<textItem>
<dataSource>
<staticValue>Page </staticValue>
</dataSource>
<style>
<defaultStyles>
<defaultStyle refStyle="usas_footer"/>
</defaultStyles>
</style>
</textItem>
<pageNumber>
<style>
<defaultStyles>
<defaultStyle refStyle="u_footer"/>
</defaultStyles>
</style>
</pageNumber>
</contents>
<style>
<CSS value="vertical-align:top;text-align:right;width:40%"/>
</style>
</tableCell>
</tableCells>
</tableRow>
</tableRows>
<style>
<defaultStyles>
<defaultStyle refStyle="tb"/>
</defaultStyles>
<CSS value="border-collapse:collapse;width:100%"/>
</style>
</table>
<HTMLItem>
<dataSource>
<staticValue>&lt;style type=&quot;text/css&quot;&gt;
@media screen {
.pb { border: 0 !important; }
.pg { background-color: #fff !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }
.pp { margin-bottom: 0 !important; }
body.viewer { background-color: #fff !important; }
.pageFooter { padding: 0 5px; }
.u_p tbody tr:nth-child(2n+2) td { background:#f3f3f3; }
}
@media print {
.pb { border: 0 !important; }
.pg { background-color: #fff !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }
.pp { margin-bottom: 0 !important; }
body.viewer { background-color: #fff !important; }
.pageFooter { padding: 0 5px; }
.u_appinfo map { width: 386px !important; height: 270px !important; }
.u_p tbody tr:nth-child(2n+2) td { background:#f3f3f3; }
}
&lt;/style&gt;</staticValue>
</dataSource>
</HTMLItem></contents>
</pageFooter>
</page>
</reportPages>
</layout>
</layouts>
<XMLAttributes>
<XMLAttribute output="no" name="RS_CreateExtendedDataItems" value="true"/>
<XMLAttribute output="no" name="listSeparator" value=","/>
<XMLAttribute output="no" name="RS_modelModificationTime" value=""/>
</XMLAttributes>
</report>
</template>

raywilliams

Cancel my last reply. I remember now that I moved the HTML Item to the end of the Footer. I had previously put the HTML Item right below the list and THAT's when it was disappearing. Moving it away from the list worked! Thanks again, MFGF, for your help! Can I upvote you or anything like that here?

MFGF

Ah! You fixed it before I got time to look. Sorry - lots going on today. Glad it's sorted! :)

You can increase any member's score by pressing the "Applaud" link below their name. Pressing "Warn" adds one to their negative score. You can see I've managed to accrue four Warns over the years. :)

MF.
Meep!