Thread: Insert the SQL in the report [not working]

Insert the SQL in the report [not working]

From
"Ezequias Rodrigues da Rocha"
Date:
Hi list,<br /><br />I don't know why the option <span style="font-weight: bold;">'Insert the SQL in the report'
</span>inthe Object List Report (<a href="http://static.flickr.com/104/303479551_0cd6413110_o.jpg">link</a>) is not
working.<br /><br />Is there anything I couldn't doing ok ?<br /><br /><br />Regards ...<br clear="all" /><br /><br />
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<br
/>                                  Atenciosamente(Sincerely) <br />                        Ezequias Rodrigues da
Rocha<br/> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<br />A pior das democracias ainda é
melhordo que a melhor das ditaduras<br />The worst of democracies is still better than the better of dictatorships <br
/><ahref="http://ezequiasrocha.blogspot.com/">http://ezequiasrocha.blogspot.com/</a> 

Re: Insert the SQL in the report [not working]

From
Dave Page
Date:
Ezequias Rodrigues da Rocha wrote:
> Hi list,
> 
> I don't know why the option 'Insert the SQL in the report' in the Object 
> List Report (link 
> <http://static.flickr.com/104/303479551_0cd6413110_o.jpg>) is not working.
> 
> Is there anything I couldn't doing ok ?

That option only works for reports that have SQL (ie. because they came 
from the Query Tool). I'll look at disabling it when it's not appropriate.

Regards, Dave.



Re: Insert the SQL in the report [not working]

From
Dave Page
Date:
Ezequias Rodrigues da Rocha wrote:
> Dave, please check the #13 (enter keys) on the comments Memo.
> 
> Long Comments are not fine on the html report (I personally must put 
> many <br> tags each time my comments are long).

Why? If you have a long line, it will wrap in the browser. Carriage 
returns get automatically translated to <br />.

Regards Dave


Re: Insert the SQL in the report [not working]

From
"Ezequias Rodrigues da Rocha"
Date:
In my case not.
Did you test it on Firefox 2.0 ?

2006/11/23, Dave Page <dpage@postgresql.org>:
Ezequias Rodrigues da Rocha wrote:
> Dave, please check the #13 (enter keys) on the comments Memo.
>
> Long Comments are not fine on the html report (I personally must put
> many <br> tags each time my comments are long).

Why? If you have a long line, it will wrap in the browser. Carriage
returns get automatically translated to <br />.

Regards Dave



--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                                  Atenciosamente (Sincerely)
                        Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/

Re: Insert the SQL in the report [not working]

From
Dave Page
Date:
Ezequias Rodrigues da Rocha wrote:
> In my case not.
> Did you test it on Firefox 2.0 ?

Yes, before I emailed you. And IE7. See the attached screenshot.

Regards, Dave,

Attachment

Re: Report stylesheet bug (was: Insert the SQL

From
Dave Page
Date:
Ezequias Rodrigues da Rocha wrote:
> I say comments not Report Notes.
>
> Source and Comment are definetly not ok.
>
> See my attached image.

Ahh, sorry - misread your message. After spending an hour or so trying
to figure it out with one of the guys here, I've come to the conclusion
that we simply don't know why it's broken (I'm far from an expert in
XSL). If anyone has an idea, I'm all ears...

The stylesheet can be found at
http://www.pgadmin.org/docs/1.6/default-xsl.html - the problem appears
to be in the last two template, the first of which should call the
second but apparently does not. The second is used for the notes and SQL
at the bottom of the reports so is obviously not totally broken:

<xsl:template match="*" mode="cells">
   <xsl:param name="row" />
     <td class="ReportTableValueCell">
     <xsl:choose>
       <xsl:when test="$row/@*[name() = current()/@id]|$row/*[name() =
current()/@id] != ''">
         <xsl:call-template name="substitute">
           <xsl:with-param name="string" select="$row/@*[name() =
current()/@id]|$row/*[name() = current()/@id]" />
         </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
         <xsl:text> </xsl:text>
       </xsl:otherwise>
     </xsl:choose>
   </td>
</xsl:template>

<xsl:template name="substitute">
    <xsl:param name="string" />
    <xsl:param name="from" select="'
'" />
    <xsl:param name="to">
       <br />
    </xsl:param>
    <xsl:choose>
       <xsl:when test="contains($string, $from)">
          <xsl:value-of select="substring-before($string, $from)" />
          <xsl:copy-of select="$to" />
          <xsl:call-template name="substitute">
             <xsl:with-param name="string"
select="substring-after($string, $from)" />
             <xsl:with-param name="from" select="$from" />
             <xsl:with-param name="to" select="$to" />
          </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
          <xsl:value-of select="$string" />
       </xsl:otherwise>
    </xsl:choose>
</xsl:template>

Regards, Dave.

Re: Report stylesheet bug (was: Insert the SQL

From
"Ezequias Rodrigues da Rocha"
Date:
Dave, I really needs a css different from default. Do you have any ? I
don't know notthing about css neither xls but a little of xml.

I only want a nice documentation and a way to put some images to
personalize my document too.

Any help will be welcomed.

Regards
Ezequias

2006/11/23, Dave Page <dpage@postgresql.org>:
> Ezequias Rodrigues da Rocha wrote:
> > I say comments not Report Notes.
> >
> > Source and Comment are definetly not ok.
> >
> > See my attached image.
>
> Ahh, sorry - misread your message. After spending an hour or so trying
> to figure it out with one of the guys here, I've come to the conclusion
> that we simply don't know why it's broken (I'm far from an expert in
> XSL). If anyone has an idea, I'm all ears...
>
> The stylesheet can be found at
> http://www.pgadmin.org/docs/1.6/default-xsl.html - the problem appears
> to be in the last two template, the first of which should call the
> second but apparently does not. The second is used for the notes and SQL
> at the bottom of the reports so is obviously not totally broken:
>
> <xsl:template match="*" mode="cells">
>    <xsl:param name="row" />
>      <td class="ReportTableValueCell">
>      <xsl:choose>
>        <xsl:when test="$row/@*[name() = current()/@id]|$row/*[name() =
> current()/@id] != ''">
>          <xsl:call-template name="substitute">
>            <xsl:with-param name="string" select="$row/@*[name() =
> current()/@id]|$row/*[name() = current()/@id]" />
>          </xsl:call-template>
>        </xsl:when>
>        <xsl:otherwise>
>          <xsl:text> </xsl:text>
>        </xsl:otherwise>
>      </xsl:choose>
>    </td>
> </xsl:template>
>
> <xsl:template name="substitute">
>     <xsl:param name="string" />
>     <xsl:param name="from" select="'
'" />
>     <xsl:param name="to">
>        <br />
>     </xsl:param>
>     <xsl:choose>
>        <xsl:when test="contains($string, $from)">
>           <xsl:value-of select="substring-before($string, $from)" />
>           <xsl:copy-of select="$to" />
>           <xsl:call-template name="substitute">
>              <xsl:with-param name="string"
> select="substring-after($string, $from)" />
>              <xsl:with-param name="from" select="$from" />
>              <xsl:with-param name="to" select="$to" />
>           </xsl:call-template>
>        </xsl:when>
>        <xsl:otherwise>
>           <xsl:value-of select="$string" />
>        </xsl:otherwise>
>     </xsl:choose>
> </xsl:template>
>
> Regards, Dave.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>


--
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                                  Atenciosamente (Sincerely)
                        Ezequias Rodrigues da Rocha
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
 http://ezequiasrocha.blogspot.com/

Re: Report stylesheet bug

From
Dave Page
Date:
Ezequias Rodrigues da Rocha wrote:
> Dave, I really needs a css different from default. Do you have any ? I
> don't know notthing about css neither xls but a little of xml.
>
> I only want a nice documentation and a way to put some images to
> personalize my document too.
>
> Any help will be welcomed.

Sorry, I don't have any alternate stylesheets, XSL or CSS. I would
suggest just taking the CSS at the top of
http://www.pgadmin.org/docs/1.6/default-xsl.html, and saving it in a
file which you then use as an external custom stylesheet. Then just
adjust the color options until you get what you are looking for.

If you want to do more than can be done in CSS, then you will need to do
a similar exercise with the XSL stylesheet, but that's *much* more complex.

I find the following site a good reference for HTML/CSS/XML/XSL info:
http://www.w3schools.com/default.asp

Regards, Dave.