[Tellico-users] Modification of some report templates

View: New views
4 Messages — Rating Filter:   Alert me  

[Tellico-users] Modification of some report templates

by patrick guignot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Robby,

I try to modify some xsl reports files in /usr/share/apps/tellico/report-templates in order to have reports wich better suits my needs.
I have two dumb questions about this reports (in case of mangling of the xsl code examples by my webmail I add a txt file with the duplicate content of this mail).

1) In the file Group_View.xsl I can read this :

<!-- To choose which fields of each entry are printed, change the
     string to a space separated list of field names. To know what
     fields are available, check the Tellico data file for <field>
     elements. -->
<xsl:param name="column-names" select="'title'"/>
<xsl:variable name="columns" select="str:tokenize($column-names)"/>

The comment says "change the string"...well yes but wich string ? I tried different things but failed.
If I have a Tellico collection with 3 fields : foo, bar and baz and if I want a report with only foo and bar what is the syntax I must use ?



2) In the file Image_List.xsl there is a hardcoded title for the report :

</style>
   <title>Tellico</title>
  </head>

How can I use my collection title instead of this hardcoded value ?
Of course there is the solution to create a report for each collection with different hardcoded titles in each of these reports...but it will be better to replace the hardcoded value by some variable..but I don't know the syntax.

Thanks in davance for your answer.

Patrick


Hello Robby,

I try to modify some xsl reports files in /usr/share/apps/tellico/report-templates in order to have reports wich better suits my needs.
I have two dumb questions about this reports (in case of mangling of the xsl code examples by my webmail I add a txt file with the duplicate content of this mail).

1) In the file Group_View.xsl I can read this :

<!-- To choose which fields of each entry are printed, change the
     string to a space separated list of field names. To know what
     fields are available, check the Tellico data file for <field>
     elements. -->
<xsl:param name="column-names" select="'title'"/>
<xsl:variable name="columns" select="str:tokenize($column-names)"/>

The comment says "change the string"...well yes but wich string ? I tried different things but failed.
If I have a Tellico collection with 3 fields : foo, bar and baz and if I want a report with only foo and bar what is the syntax I must use ?



2) In the file Image_List.xsl there is a hardcoded title for the report :

</style>
   <title>Tellico</title>
  </head>

How can I use my collection title instead of this hardcoded value ?
Of course there is the solution to create a report for each collection with different hardcoded titles in each of these reports...but it will be better to replace the hardcoded value by some variable..but I don't know the syntax.

Thanks in davance for your answer.

Patrick

_______________________________________________
tellico-users mailing list
tellico-users@...
https://mail.kde.org/mailman/listinfo/tellico-users

Re: [Tellico-users] Modification of some report templates

by robbystephenson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 23 August 2009, patrick guignot wrote:

> 1) In the file Group_View.xsl I can read this :
>
> <!-- To choose which fields of each entry are printed, change the
>      string to a space separated list of field names. To know what
>      fields are available, check the Tellico data file for <field>
>      elements. -->
> <xsl:param name="column-names" select="'title'"/>
> <xsl:variable name="columns" select="str:tokenize($column-names)"/>
>
> The comment says "change the string"...well yes but wich string ? I tried
> different things but failed. If I have a Tellico collection with 3 fields
> : foo, bar and baz and if I want a report with only foo and bar what is
> the syntax I must use ?

<xsl:param name="column-names" select="'foo bar'"/>

And note there are single-quotes inside the double-quotes. XSL requires that
for string.

> 2) In the file Image_List.xsl there is a hardcoded title for the report :
>
> </style>
>    <title>Tellico</title>
>   </head>
>
> How can I use my collection title instead of this hardcoded value ?

<title>
  <xsl:value-of select="tc:collection/@title"/>
</title>

I should probably fix that.

I think those should work, I didn't test them yet.

Robby

_______________________________________________
tellico-users mailing list
tellico-users@...
https://mail.kde.org/mailman/listinfo/tellico-users

[Tellico-users] Re : Modification of some report templates

by patrick guignot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

For point 1) there is no change in the html file generated by the Group view report if I put <xsl:param name="column-names" select="'foo bar'"/> in Group_View.xsl.
The html file generated still contains foo bar and baz....
But I've found a solution : In the Column View of Tellico if I disable baz (by right-clicking on the header of the view in order to open the menu and deselecting the baz field) then the html file generated by the report contains only foo and bar.

For point 2) It works perfectly.

Thanks for your answers Robby.

Patrick


De : Robby Stephenson <robby@...>
À : tellico-users@...
Envoyé le : Mardi, 25 Août 2009, 16h17mn 15s
Objet : Re: [Tellico-users] Modification of some report templates

On Sunday 23 August 2009, patrick guignot wrote:

> 1) In the file Group_View.xsl I can read this :
>
> <!-- To choose which fields of each entry are printed, change the
>      string to a space separated list of field names. To know what
>      fields are available, check the Tellico data file for <field>
>      elements. -->
> <xsl:param name="column-names" select="'title'"/>
> <xsl:variable name="columns" select="str:tokenize($column-names)"/>
>
> The comment says "change the string"....well yes but wich string ? I tried
> different things but failed. If I have a Tellico collection with 3 fields
> : foo, bar and baz and if I want a report with only foo and bar what is
> the syntax I must use ?

<xsl:param name="column-names" select="'foo bar'"/>

And note there are single-quotes inside the double-quotes. XSL requires that
for string.

> 2) In the file Image_List.xsl there is a hardcoded title for the report :
>
> </style>
>    <title>Tellico</title>
>  </head>
>
> How can I use my collection title instead of this hardcoded value ?

<title>
  <xsl:value-of select="tc:collection/@title"/>
</title>

I should probably fix that.

I think those should work, I didn't test them yet.

Robby

_______________________________________________
tellico-users mailing list
tellico-users@...
https://mail.kde.org/mailman/listinfo/tellico-users


_______________________________________________
tellico-users mailing list
tellico-users@...
https://mail.kde.org/mailman/listinfo/tellico-users

Re: [Tellico-users] Re : Modification of some report templates

by robbystephenson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tuesday 25 August 2009, patrick guignot wrote:
> For point 1) there is no change in the html file generated by the Group
> view report if I put <xsl:param name="column-names" select="'foo bar'"/>
> in Group_View.xsl. The html file generated still contains foo bar and
> baz...

Oh right, I forgot about precedence. Those parameters work if you're running
the XSL transform from the command-line. When Tellico generates the HTML
itself, it passes in the current view, which overrides the variables in the
file. That's why you got the columns that are displayed in the view.

If you wanted to generate the HTML without running Tellico
unzip -p books.tc tellico.xml | xsltproc Group_View.xsl -

Robby
_______________________________________________
tellico-users mailing list
tellico-users@...
https://mail.kde.org/mailman/listinfo/tellico-users