×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Dynamically Displaying Document Name

Dynamically Displaying Document Name

Dynamically Displaying Document Name

(OP)
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!

RE: Dynamically Displaying Document Name

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="/mi/rit/rd/mi/in/oi/@n" />

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

Chael

RE: Dynamically Displaying Document Name

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

RE: Dynamically Displaying Document Name

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

THen modify the xsl to display the contents on your document.  You can test it out with testxml.

RE: Dynamically Displaying Document Name

Thank you very much.
I'll try that.

mm236

RE: Dynamically Displaying Document Name

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="7" ttl="Choose from all elements of 'Company'." mn="Choose from all elements of 'Company'." ru="15" mr="1" usd="1"

cl="1" pin="1">






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

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

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

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

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

did="54F3D26011D2896560009A8E67019608">Administrator</ow></oi><oi id="28" n="ID" did="EF4E372D11D53E7F90007483F5309227"

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

did="EF4E373211D53E7F90007483F5309227" tp="21" stp="5377" sta="1073873279"><fdt rfd="29" ud=""

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

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

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







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

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

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

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

rfd="32">SKEY</fu><fu rfd="33">Company</fu></fms><bfs cc="1"><fu rfd="33">Company</fu></bfs><tfs cc="1"><fu

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

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

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

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

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

rfd="35">SKEY</fu><fu rfd="36">Company</fu></fms><bfs cc="1"><fu rfd="36">Company</fu></bfs><tfs cc="1"><fu

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ei="1C9B7AE511D662AD90003A8366A29327:9999999906" emt="1" art="1"><fv bfi="1">UNK_LVL_1_0006

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

ipm="1" did="A8F4B18611D6FBDA0100A88E8219D702" tp="10"/></pif>

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

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

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

I've been trying different values from the Pif and Pa tags.
I've been trying with and without "add:"
I'm also not sure if I need a <xsl:apply-templates select="add:***" />.
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 "414 ELECTRONICS" on a web page / document.

Thanks.
mm236

RE: Dynamically Displaying Document Name

(OP)
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!

RE: Dynamically Displaying Document Name

Great.
Thanks.
I appreciate it.

My e-mail address is mmurphy@arrow.com

mm236

RE: Dynamically Displaying Document Name

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

RE: Dynamically Displaying Document Name

This XSL will display on 414 Electronics...

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">;
    <xsl:template match="/">
        <html>
            <head />
            <body>
                <xsl:apply-templates />
            </body>
        </html>
    </xsl:template>
    <xsl:template match="pa" />
    <xsl:template match="pif">
        <xsl:for-each select="pa">
            <xsl:for-each select="mi">
                <xsl:for-each select="es">
                    <xsl:for-each select="e">
                        <xsl:for-each select="@disp_n">
                            <xsl:value-of select="." />
                        </xsl:for-each>
                    </xsl:for-each>
                </xsl:for-each>
            </xsl:for-each>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

RE: Dynamically Displaying Document Name

...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="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">;
    <xsl:template match="/">
        <html>
            <head />
            <body>
                <xsl:apply-templates />
            </body>
        </html>
    </xsl:template>
    <xsl:template match="pa" />
    <xsl:template match="pif">
        <xsl:for-each select="pa">
            <xsl:for-each select="mi">
                <xsl:for-each select="es">
                    <xsl:for-each select="e">
                        <xsl:for-each select="@disp_n">
                            <xsl:value-of select="." />
                        </xsl:for-each>
                    </xsl:for-each>
                </xsl:for-each>
            </xsl:for-each>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

RE: Dynamically Displaying Document Name

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...

RE: Dynamically Displaying Document Name


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

RE: Dynamically Displaying Document Name

(OP)
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!

RE: Dynamically Displaying Document Name

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

RE: Dynamically Displaying Document Name

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close