#1 2016-02-29 00:28:44

tomharney
Member
Registered: 2014-03-11

Difficulty with XDoc Templates

I'm unable to find a sample of an XDoc template.  Could someone point me in the right direction?

I assume when I create a template, it's simply a merge field with each field name from a dynamic list.

Any assistance is greatly appreciated!

Offline

#2 2016-02-29 12:41:13

tomharney
Member
Registered: 2014-03-11

Re: Difficulty with XDoc Templates

I have literally tried every combination imaginable with an XDoc template to no avail.  And just now, independently confirmed my XDoc template is valid using an implementation of XDoc external to report server.  I'm running the last open source release of ReportServer or version 2.2.2.5639-1.

Does XDoc even function at all in the open source release?  I noticed in the Datenwerke demo, that XDoc is not a template option.  Thanks all.

Offline

#3 2016-02-29 21:19:14

Thorsten J. Krause
Guest

Re: Difficulty with XDoc Templates

Hi Tom,

sorry for the delay, it took me some time to figure this out myself. There is a mistake in our documentation: Do not include the square brackets into the definition of your mergefields. Please take a look at the screenshot below on how to set this up:

5yA9q.jpg

Cheers,
Thorsten

#4 2016-02-29 21:37:15

tomharney
Member
Registered: 2014-03-11

Re: Difficulty with XDoc Templates

Thanks Thorsten and Karolina!  Karolina was so kind to provide me with some examples via email.

The foreach iterator was the missing link for me.  I'm having one other difficulty.  Is there a limit to the length of the field name?

I'm using the following field name in my XDoc template: 

$x.PHIL_TO_LIBRARY_2016

Offline

#5 2016-02-29 21:47:22

Thorsten J. Krause
Guest

Re: Difficulty with XDoc Templates

Hi Tom,

glad to hear you figured it out.
As for a length restriction: I don't think there is one. I tried it with "PHIL_TO_LIBRARY_2016" and it worked fine. Is there an error message or what is the result?

Cheers,
Thorsten

#6 2016-02-29 21:58:12

tomharney
Member
Registered: 2014-03-11

Re: Difficulty with XDoc Templates

I think the problem may lie with NULL values.   This field and another field may be null in some cases.   However, no record in the resultant output contains any data.

Offline

#7 2016-02-29 22:17:55

Thorsten J. Krause
Guest

Re: Difficulty with XDoc Templates

I made a quick test and for me null values cause no problems - if the field has no value it just print the field expression.

#8 2016-02-29 22:42:15

tomharney
Member
Registered: 2014-03-11

Re: Difficulty with XDoc Templates

It's definitely the NULL value.  I have just confirmed.  Perhaps I can do null checking within Velocity?  Or I wonder if this is a problem in the implementation?  I don't find any error messages in the tomcat logs.

Offline

#9 2016-02-29 22:45:13

tomharney
Member
Registered: 2014-03-11

Re: Difficulty with XDoc Templates

In the interim, I will replace null values with a single space ' ' using the NVL function (an Oracle function) in my SQL code or NVL(x.fieldname,' ')   Our database environment is Oracle 12g.

Offline

#10 2016-02-29 22:48:02

Thorsten J. Krause
Guest

Re: Difficulty with XDoc Templates

#11 2016-02-29 22:52:09

tomharney
Member
Registered: 2014-03-11

Re: Difficulty with XDoc Templates

Thank you, Thorsten.  I found those as well during my Google searches.  As always, the members of this forum are exceedingly kind and helpful.   Thanks everyone!

Offline

#12 2021-04-29 16:08:57

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Difficulty with XDoc Templates

Hi,

Note that we added a simple XDoc example to our reportserver-samples github:
https://github.com/infofabrik/reportserver-samples

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB