Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically Displaying Document Name 1

Status
Not open for further replies.

petperson

Programmer
Oct 2, 2002
106
0
0
US
I have a document (7.2.1) which has 2 grids and 4 graphs. I would like to display the name of the Document either above or below the grids/graphs - kind of like in the header or footer. I know I can manually add a name in Page Setup of HTML, but is there a way to do this dynamically so either in Web or Desktop it is visible? thanks!
 
You will need to create a customized XSL for this...not as hard as it seems. A recent poster (fukudahs) offered to help people with XSL -- I think if you got in touch with him he could whip something out in no time. If he doesn't check this board in a couple of days I can get you started.

Actually, I will give you a hint...look for the following string in one of the sample XSL files (i.e. document.xsl XSLs\db\samples):

<!-- report link -->

Move the whole <A to A> section to the top of the XSL and strip out everything but the following line:
<xsl:value-of select=&quot;/mi/rit/rd/mi/in/oi/@n&quot; />

This node, combined with valid HTML syntax, will give you the report name.

Chael
 
Hi,

I have a smiliar question. Are the values selected by the user for prompts stored in variable or somewhere? I have a document with 6 graphs. They are all based on the same prompts. I would like to display, at the top of the document, like a header, showing the values the user entered before the document was run. Does anyone know if this is possible and how?

Thanks
mm236
 
yes, it is possible. The prompt answers are part of the report xml. The pif is the &quot;prompt info&quot; tag. Look for the child tag &quot;pa&quot; which stands for prompt answer.

THen modify the xsl to display the contents on your document. You can test it out with testxml.
 
Thank you very much.
I'll try that.

mm236
 
I've been trying to print the prompt value but I can't get it to work. (I don't know XSL but I've been reading posts and tutorials that I've found online for about a week.) The Pif and Pa values follow:

********************************************************

<pif pt=&quot;7&quot; ttl=&quot;Choose from all elements of 'Company'.&quot; mn=&quot;Choose from all elements of 'Company'.&quot; ru=&quot;15&quot; mr=&quot;1&quot; usd=&quot;1&quot;

cl=&quot;1&quot; pin=&quot;1&quot;>






<pa ia=&quot;1&quot;><mi mnri=&quot;26&quot; mxri=&quot;29&quot;><in><oi id=&quot;26&quot; n=&quot;Company&quot; did=&quot;1C9B7AE511D662AD90003A8366A29327&quot; tp=&quot;12&quot; stp=&quot;3072&quot;

sta=&quot;1073873279&quot; ab=&quot;&quot; des=&quot;&quot; ct=&quot;10/10/02 4:35:24 PM&quot; mdt=&quot;10/10/02 4:35:24 PM&quot; acg=&quot;7&quot;><ow

did=&quot;54F3D26011D2896560009A8E67019608&quot;>Administrator</ow></oi></in><es cc=&quot;1&quot; pcc=&quot;1&quot; ste=&quot;1&quot; bs=&quot;0&quot;><at rfd=&quot;26&quot;><mi

rfd=&quot;27&quot; mnri=&quot;27&quot; mxri=&quot;29&quot;><in><oi id=&quot;27&quot; n=&quot;Company&quot; did=&quot;1C9B7AE511D662AD90003A8366A29327&quot; tp=&quot;12&quot; stp=&quot;3072&quot;

sta=&quot;1073873279&quot; mf=&quot;1&quot; ab=&quot;&quot; des=&quot;&quot; ct=&quot;10/10/02 4:35:24 PM&quot; mdt=&quot;10/10/02 4:35:24 PM&quot; acg=&quot;7&quot;><ow

did=&quot;54F3D26011D2896560009A8E67019608&quot;>Administrator</ow></oi><oi id=&quot;28&quot; n=&quot;ID&quot; did=&quot;EF4E372D11D53E7F90007483F5309227&quot;

tp=&quot;21&quot; stp=&quot;5377&quot; sta=&quot;1073873279&quot;><fdt rfd=&quot;28&quot; ud=&quot;&quot; dt=&quot;2&quot;>SKEY</fdt></oi><oi id=&quot;29&quot; n=&quot;DESC&quot;

did=&quot;EF4E373211D53E7F90007483F5309227&quot; tp=&quot;21&quot; stp=&quot;5377&quot; sta=&quot;1073873279&quot;><fdt rfd=&quot;29&quot; ud=&quot;&quot;

dt=&quot;3&quot;>Company</fdt></oi></in><fi><fms cc=&quot;2&quot;><fu rfd=&quot;28&quot;>SKEY</fu><fu rfd=&quot;29&quot;>Company</fu></fms><bfs cc=&quot;1&quot;><fu

rfd=&quot;29&quot;>Company</fu></bfs><tfs cc=&quot;1&quot;><fu rfd=&quot;29&quot;>Company</fu></tfs></fi></mi></at><e emt=&quot;1&quot;

ei=&quot;1C9B7AE511D662AD90003A8366A29327:607110&quot; art=&quot;1&quot; disp_n=&quot;414 ELECTRONICS&quot;><fv bfi=&quot;1&quot;>414 ELECTRONICS</fv></e></es></mi></pa>







<or><at rfd=&quot;30&quot;><mi rfd=&quot;31&quot; mnri=&quot;31&quot; mxri=&quot;33&quot;><in><oi id=&quot;31&quot; n=&quot;Company&quot; did=&quot;1C9B7AE511D662AD90003A8366A29327&quot; tp=&quot;12&quot;

stp=&quot;3072&quot; sta=&quot;1073873279&quot; mf=&quot;1&quot; ab=&quot;&quot; des=&quot;&quot;/><oi id=&quot;32&quot; n=&quot;ID&quot; did=&quot;EF4E372D11D53E7F90007483F5309227&quot; tp=&quot;21&quot; stp=&quot;5377&quot;

sta=&quot;1073873279&quot;><fdt rfd=&quot;32&quot; ud=&quot;&quot; dt=&quot;2&quot;>SKEY</fdt></oi><oi id=&quot;33&quot; n=&quot;DESC&quot; did=&quot;EF4E373211D53E7F90007483F5309227&quot;

tp=&quot;21&quot; stp=&quot;5377&quot; sta=&quot;1073873279&quot;><fdt rfd=&quot;33&quot; ud=&quot;&quot; dt=&quot;3&quot;>Company</fdt></oi></in><fi><fms cc=&quot;2&quot;><fu

rfd=&quot;32&quot;>SKEY</fu><fu rfd=&quot;33&quot;>Company</fu></fms><bfs cc=&quot;1&quot;><fu rfd=&quot;33&quot;>Company</fu></bfs><tfs cc=&quot;1&quot;><fu

rfd=&quot;33&quot;>Company</fu></tfs></fi></mi></at></or><pa idl=&quot;1&quot;><mi mnri=&quot;34&quot; mxri=&quot;36&quot;><in/><es cc=&quot;15&quot; pcc=&quot;15&quot; ste=&quot;1&quot;

bs=&quot;50&quot;><at rfd=&quot;30&quot;><mi rfd=&quot;34&quot; mnri=&quot;34&quot; mxri=&quot;36&quot;><in><oi id=&quot;34&quot; n=&quot;Company&quot; did=&quot;1C9B7AE511D662AD90003A8366A29327&quot;

tp=&quot;12&quot; stp=&quot;3072&quot; sta=&quot;1073873279&quot; mf=&quot;1&quot;/><oi id=&quot;35&quot; n=&quot;ID&quot; did=&quot;EF4E372D11D53E7F90007483F5309227&quot; tp=&quot;21&quot; stp=&quot;5377&quot;

sta=&quot;1073873279&quot;><fdt rfd=&quot;35&quot; ud=&quot;&quot; dt=&quot;2&quot;>SKEY</fdt></oi><oi id=&quot;36&quot; n=&quot;DESC&quot; did=&quot;EF4E373211D53E7F90007483F5309227&quot;

tp=&quot;21&quot; stp=&quot;5377&quot; sta=&quot;1073873279&quot;><fdt rfd=&quot;36&quot; ud=&quot;&quot; dt=&quot;3&quot;>Company</fdt></oi></in><fi><fms cc=&quot;2&quot;><fu

rfd=&quot;35&quot;>SKEY</fu><fu rfd=&quot;36&quot;>Company</fu></fms><bfs cc=&quot;1&quot;><fu rfd=&quot;36&quot;>Company</fu></bfs><tfs cc=&quot;1&quot;><fu

rfd=&quot;36&quot;>Company</fu></tfs></fi></mi></at><e ei=&quot;1C9B7AE511D662AD90003A8366A29327:600625&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>120

VIEWTEK</fv></e><e ei=&quot;1C9B7AE511D662AD90003A8366A29327:602725&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>230 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:602748&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>322 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:603509&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>324 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:603949&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>330 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:604118&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>371 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:604690&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>373 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:604871&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>374 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:605464&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>375 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:605854&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>376 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:607110&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>414 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:607177&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>510 CO, LLC</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:607194&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>571 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:2786753&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>581 CO</fv></e><e

ei=&quot;1C9B7AE511D662AD90003A8366A29327:9999999906&quot; emt=&quot;1&quot; art=&quot;1&quot;><fv bfi=&quot;1&quot;>UNK_LVL_1_0006

UNK_LVL_1_0006</fv></e></es></mi></pa><prs><pr n=&quot;PSXSL&quot; v=&quot;DefaultPSXSL.XSL&quot;/><pr n=&quot;PSISCART&quot; v=&quot;-1&quot;/></prs><loc pin=&quot;0&quot;

ipm=&quot;1&quot; did=&quot;A8F4B18611D6FBDA0100A88E8219D702&quot; tp=&quot;10&quot;/></pif>

********************************************************

I'm trying to get the &quot;414 ELECTRONICS&quot; value.
I've been using code similar to (using different values where I've shown ***):

<xsl:template match=&quot;add:***&quot;>
</b><xsl:value-of select=&quot;@***&quot;/></b><br/>
***: <xsl:value-of select=&quot;add:***&quot;/>
</xsl:template>

I've been trying different values from the Pif and Pa tags.
I've been trying with and without &quot;add:&quot;
I'm also not sure if I need a <xsl:apply-templates select=&quot;add:***&quot; />.
Actually, I'm not sure if any of this is right and I'm close or if I'm way off target.
I spent a week working on it by myself trying to learn before I asked for help again but I'm stuck. I've also been looking for a XSL book but the reviews on Amazon for the ones that are out, aren't so hot.

I'd appreciate any help. I'd appreciate the exact line of code I need even more. All I want to do is display the prompt value &quot;414 ELECTRONICS&quot; on a web page / document.

Thanks.
mm236
 
mm236,

You can do this without hacking the XSL. First create a 'display' report displaying the attributes you want to be a part of your dynamic heading. Prompts in this report must match the prompts in your other grids/graphs from the document. Once you have this 'display' report, add it to your document at the top and center. Your prompt answers will appear in your document when it's run. I have an example of this if you want (from another reply I received) - send me your email address and I'll be glad to forward it!
 
Great.
Thanks.
I appreciate it.

My e-mail address is mmurphy@arrow.com

mm236
 
Hi petperson,

I would appreciate if you can also forward me the same that you have mentioned above. Even I have a similar problem.

My Email Id is madhus14@rediffmail.com

Thanks

Use14
 
This XSL will display on 414 Electronics...

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot; <xsl:template match=&quot;/&quot;>
<html>
<head />
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match=&quot;pa&quot; />
<xsl:template match=&quot;pif&quot;>
<xsl:for-each select=&quot;pa&quot;>
<xsl:for-each select=&quot;mi&quot;>
<xsl:for-each select=&quot;es&quot;>
<xsl:for-each select=&quot;e&quot;>
<xsl:for-each select=&quot;@disp_n&quot;>
<xsl:value-of select=&quot;.&quot; />
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
 
...sorry, there was an extra character in the XSL...use this instead if you are still trying this...this took only a few minutes to create with XMLSpy Stylesheet designer, in case you are interested.

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot; <xsl:template match=&quot;/&quot;>
<html>
<head />
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match=&quot;pa&quot; />
<xsl:template match=&quot;pif&quot;>
<xsl:for-each select=&quot;pa&quot;>
<xsl:for-each select=&quot;mi&quot;>
<xsl:for-each select=&quot;es&quot;>
<xsl:for-each select=&quot;e&quot;>
<xsl:for-each select=&quot;@disp_n&quot;>
<xsl:value-of select=&quot;.&quot; />
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
 
well, it seems that tek-tips is adding some characters for me...the semicolon at the end of the second line shouldn't be there...
 

Thanks chael,

I'll try it.
I downloaded the trial version of XMLSpy and I'm going to try that out as well.

Thanks again,
mm236
 
so does this code go to the top of the XSL like you mentioned in a previous post? Do you still need to move the <A> </A> to the top and then use this code you provided for the report link? My version of XMLSpy has expired..is there another editing tool you know of? thanks!
 
My XSL works with the XML provided...when/if I get a chance I will try and write something that can be applied to a report so that it will show the prompt selections, and then the report.

To run the XML and XSL together use TestXML.exe -- it is provided as a utility w/ MicroStrategy...under Common Files / MicroStrategy.

Make sure to get rid of the extra semicolon at the end of the second line of the XSL...

I'm not sure I'll get a chance to develop anything in the near future so if someone else out there wants to give this a go, by all means...

For the meantime petperson's solution works, but the optimal solution is to have it all done by one XSL.

Chael
 
One more post, then I am done (for now)...this thread evolved from one question regarding how to simulate a header and footer using XSL. The solution I first gave re: taking adantage of the link (which usually shows at the bottom of a report) is till valid. The XSLs can be modified to appear at the top of the report and without any linking.

The thread then evolved into trying to show prompt answers. These are two different subject areas.

If anyone wants to collaborate and try and come up with one XSL that shows both the report name at the top, and the prompt answers below the title, and then the report data drop me a line at cchristopher@atlanticintelligence.com

In the meantime I'll tinker with it in my spare time...

Chael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top