Discussion:
[xquery-talk] generate and schedule report
Inderjeet Singh Narang
2014-05-29 10:07:09 UTC
Permalink
I am new to xquery. I want to generate excel report through scheduler. Please help me to sort out the issue.
Your help will be greately appreciated.

Thanks & Regards
Inderjeet







DISCLAIMER

The information transmitted, including any attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you receive this email by mistake, please advise the sender and delete it immediately. Email transmission cannot be guaranteed to be secure, or error free as information could be intercepted, corrupted, lost or destroyed as a result of the transmission process. Views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Please be aware that the Company monitors email communications through our networks for regulatory compliance purposes. NIIT Technologies Limited and its related entities consider the privacy of its clients to be of utmost importance and works to protect it. The Privacy Policy of the Company can be accessed from our website “www.niit-tech.com. (s).
Murray, Gregory
2014-05-29 12:41:51 UTC
Permalink
Please post a short example of what the input looks like and what of the format you want to output. Alternatively, it sounds like you are converting one form of XML to another, in which case XSLT might be a simpler option than XQuery.


On May 29, 2014, at 6:07 AM, Inderjeet Singh Narang wrote:

I am new to xquery. I want to generate excel report through scheduler. Please help me to sort out the issue.
Your help will be greately appreciated.

Thanks & Regards
Inderjeet

_______________________________________________
***@x-query.com<mailto:***@x-query.com>
http://x-query.com/mailman/listinfo/talk
Loren Cahlander
2014-05-29 15:23:01 UTC
Permalink
What system are you using? I am thinking eXist-db due to the scheduler reference.

Sent from my iPad

> On May 29, 2014, at 8:41 AM, "Murray, Gregory" <***@ptsem.edu> wrote:
>
> Please post a short example of what the input looks like and what of the format you want to output. Alternatively, it sounds like you are converting one form of XML to another, in which case XSLT might be a simpler option than XQuery.
>
>
>> On May 29, 2014, at 6:07 AM, Inderjeet Singh Narang wrote:
>>
>> I am new to xquery. I want to generate excel report through scheduler. Please help me to sort out the issue.
>> Your help will be greately appreciated.
>>
>> Thanks & Regards
>> Inderjeet
>>
>> _______________________________________________
>> ***@x-query.com
>> http://x-query.com/mailman/listinfo/talk
>
> _______________________________________________
> ***@x-query.com
> http://x-query.com/mailman/listinfo/talk
Inderjeet Singh Narang
2014-05-29 16:38:07 UTC
Permalink
Hi,
I am using eXist-db and easydita.

I want to fetch records from eXist-db and then generate excel report through scheduler at a specified time say 1:00 PM everyday. At 1:00 PM scheduler will run and will generate excel report by fetching data from eXist-db.

Thanks
Inderjeet
________________________________
From: Loren Cahlander [***@gmail.com]
Sent: Thursday, May 29, 2014 8:53 PM
To: Murray, Gregory
Cc: Inderjeet Singh Narang; ***@x-query.com
Subject: Re: [xquery-talk] generate and schedule report

What system are you using? I am thinking eXist-db due to the scheduler reference.

Sent from my iPad

On May 29, 2014, at 8:41 AM, "Murray, Gregory" <***@ptsem.edu<mailto:***@ptsem.edu>> wrote:

Please post a short example of what the input looks like and what of the format you want to output. Alternatively, it sounds like you are converting one form of XML to another, in which case XSLT might be a simpler option than XQuery.


On May 29, 2014, at 6:07 AM, Inderjeet Singh Narang wrote:

I am new to xquery. I want to generate excel report through scheduler. Please help me to sort out the issue.
Your help will be greately appreciated.

Thanks & Regards
Inderjeet

_______________________________________________
***@x-query.com<mailto:***@x-query.com>
http://x-query.com/mailman/listinfo/talk

_______________________________________________
***@x-query.com<mailto:***@x-query.com>
http://x-query.com/mailman/listinfo/talk






DISCLAIMER

The information transmitted, including any attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you receive this email by mistake, please advise the sender and delete it immediately. Email transmission cannot be guaranteed to be secure, or error free as information could be intercepted, corrupted, lost or destroyed as a result of the transmission process. Views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Please be aware that the Company monitors email communications through our networks for regulatory compliance purposes. NIIT Technologies Limited and its related entities consider the privacy of its clients to be of utmost importance and works to protect it. The Privacy Policy of the Company can be accessed from our website “www.niit-tech.com. (s).
Loren Cahlander
2014-05-29 17:27:29 UTC
Permalink
You can generate a csv or create an open doc spreadsheet http://www.opendocumentformat.org/features/

I do not know of any module to generate an excel spreadsheet within eXist. You can read a spreadsheet using the content extraction function module.

Here is a resource for outputting a text document: http://en.wikibooks.org/wiki/XQuery/eXist_Crib_sheet#output_plain_text_document_with_no_doctype


Sent from my iPad

> On May 29, 2014, at 12:38 PM, Inderjeet Singh Narang <***@NIIT-Tech.com> wrote:
>
> Hi,
> I am using eXist-db and easydita.
>
> I want to fetch records from eXist-db and then generate excel report through scheduler at a specified time say 1:00 PM everyday. At 1:00 PM scheduler will run and will generate excel report by fetching data from eXist-db.
>
> Thanks
> Inderjeet
> From: Loren Cahlander [***@gmail.com]
> Sent: Thursday, May 29, 2014 8:53 PM
> To: Murray, Gregory
> Cc: Inderjeet Singh Narang; ***@x-query.com
> Subject: Re: [xquery-talk] generate and schedule report
>
> What system are you using? I am thinking eXist-db due to the scheduler reference.
>
> Sent from my iPad
>
> On May 29, 2014, at 8:41 AM, "Murray, Gregory" <***@ptsem.edu> wrote:
>
>> Please post a short example of what the input looks like and what of the format you want to output. Alternatively, it sounds like you are converting one form of XML to another, in which case XSLT might be a simpler option than XQuery.
>>
>>
>>> On May 29, 2014, at 6:07 AM, Inderjeet Singh Narang wrote:
>>>
>>> I am new to xquery. I want to generate excel report through scheduler. Please help me to sort out the issue.
>>> Your help will be greately appreciated.
>>>
>>> Thanks & Regards
>>> Inderjeet
>>>
>>> _______________________________________________
>>> ***@x-query.com
>>> http://x-query.com/mailman/listinfo/talk
>> _______________________________________________
>> ***@x-query.com
>> http://x-query.com/mailman/listinfo/talk
>
>
>
>
>
>
> DISCLAIMER
>
> The information transmitted, including any attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you receive this email by mistake, please advise the sender and delete it immediately. Email transmission cannot be guaranteed to be secure, or error free as information could be intercepted, corrupted, lost or destroyed as a result of the transmission process. Views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Please be aware that the Company monitors email communications through our networks for regulatory compliance purposes. NIIT Technologies Limited and its related entities consider the privacy of its clients to be of utmost importance and works to protect it. The Privacy Policy of the Company can be accessed from our website “www.niit-tech.com. (s).
Loren Cahlander
2014-05-29 17:48:47 UTC
Permalink
Here is some example code:

xquery version "3.0";

declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";

declare option output:method "text";
declare option output:media-type "text/csv";

let $nl := "&#10;"
let $header := "Column 1, Column 2, Column3"
let $text := string-join(($header, for $usage in $usages//usage
order by $usage ascending
return local:usage-csv($usage, $rel-ver-path,$release, $version, $model)
), $nl)

(: Use either :)
return $text

(: or
return xmldb:store($collection-path, 'report.csv', $text)
:)

(: to kick off a scheduled task :)
let $trigger-path := $config:app-root ||'/modules/scheduler/mytask.xq'
let $scheduled-name := 'AAA'
let $scheduled-parameters :=
element { 'parameters' } {
}
let $query := system:as-user('admin', 'xyzzy',
scheduler:schedule-xquery-periodic-job($trigger-path,1000, $scheduled-name, $scheduled-parameters, 1000, 0))
return
<results>
<message>File {$uuid} has been stored.</message>
</results>


or

scheduler:schedule-xquery-cron-job($trigger-path, "0 0 13 * * ?",$scheduled-name, $scheduled-parameters)

http://exist-db.org/exist/apps/doc/scheduler.xml





Sent from my iPad

> On May 29, 2014, at 1:27 PM, Loren Cahlander <***@gmail.com> wrote:
>
> You can generate a csv or create an open doc spreadsheet http://www.opendocumentformat.org/features/
>
> I do not know of any module to generate an excel spreadsheet within eXist. You can read a spreadsheet using the content extraction function module.
>
> Here is a resource for outputting a text document: http://en.wikibooks.org/wiki/XQuery/eXist_Crib_sheet#output_plain_text_document_with_no_doctype
>
>
> Sent from my iPad
>
>> On May 29, 2014, at 12:38 PM, Inderjeet Singh Narang <***@NIIT-Tech.com> wrote:
>>
>> Hi,
>> I am using eXist-db and easydita.
>>
>> I want to fetch records from eXist-db and then generate excel report through scheduler at a specified time say 1:00 PM everyday. At 1:00 PM scheduler will run and will generate excel report by fetching data from eXist-db.
>>
>> Thanks
>> Inderjeet
>> From: Loren Cahlander [***@gmail.com]
>> Sent: Thursday, May 29, 2014 8:53 PM
>> To: Murray, Gregory
>> Cc: Inderjeet Singh Narang; ***@x-query.com
>> Subject: Re: [xquery-talk] generate and schedule report
>>
>> What system are you using? I am thinking eXist-db due to the scheduler reference.
>>
>> Sent from my iPad
>>
>> On May 29, 2014, at 8:41 AM, "Murray, Gregory" <***@ptsem.edu> wrote:
>>
>>> Please post a short example of what the input looks like and what of the format you want to output. Alternatively, it sounds like you are converting one form of XML to another, in which case XSLT might be a simpler option than XQuery.
>>>
>>>
>>>> On May 29, 2014, at 6:07 AM, Inderjeet Singh Narang wrote:
>>>>
>>>> I am new to xquery. I want to generate excel report through scheduler. Please help me to sort out the issue.
>>>> Your help will be greately appreciated.
>>>>
>>>> Thanks & Regards
>>>> Inderjeet
>>>>
>>>> _______________________________________________
>>>> ***@x-query.com
>>>> http://x-query.com/mailman/listinfo/talk
>>> _______________________________________________
>>> ***@x-query.com
>>> http://x-query.com/mailman/listinfo/talk
>>
>>
>>
>>
>>
>>
>> DISCLAIMER
>>
>> The information transmitted, including any attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you receive this email by mistake, please advise the sender and delete it immediately. Email transmission cannot be guaranteed to be secure, or error free as information could be intercepted, corrupted, lost or destroyed as a result of the transmission process. Views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Please be aware that the Company monitors email communications through our networks for regulatory compliance purposes. NIIT Technologies Limited and its related entities consider the privacy of its clients to be of utmost importance and works to protect it. The Privacy Policy of the Company can be accessed from our website “www.niit-tech.com. (s).
Joe Wicentowski
2014-05-29 17:56:59 UTC
Permalink
> I do not know of any module to generate an excel spreadsheet within eXist. You can read a spreadsheet using the content extraction function module.

Pete Aven's article on generating Excel documents with XQuery is
straightforward to apply in eXist-db:

http://developer.marklogic.com/blog/smallchanges/2007-12-04

(His whole series of articles is worth reading if you're interested in
generating various Office documents with XQuery.)

Joe
Loren Cahlander
2014-05-29 18:43:40 UTC
Permalink
Thanks Joe!

Sent from my iPad

On May 29, 2014, at 1:56 PM, Joe Wicentowski <***@gmail.com> wrote:

>> I do not know of any module to generate an excel spreadsheet within eXist. You can read a spreadsheet using the content extraction function module.
>
> Pete Aven's article on generating Excel documents with XQuery is
> straightforward to apply in eXist-db:
>
> http://developer.marklogic.com/blog/smallchanges/2007-12-04
>
> (His whole series of articles is worth reading if you're interested in
> generating various Office documents with XQuery.)
>
> Joe
Inderjeet Singh Narang
2014-05-30 10:36:06 UTC
Permalink
Thanks for all your suggestions.
I am able to generate excel report as mentioned here http://jsfiddle.net/lesson8/wVejP/. This report get generated when button is clicked.
Now i want to generate the report through scheduler as scheduler is not going to click on button so I am stuck here.
any suggestion would be appreciated.

Thanks
Inderjeet
________________________________________
From: Loren Cahlander [***@gmail.com]
Sent: Friday, May 30, 2014 12:13 AM
To: Joe Wicentowski
Cc: Inderjeet Singh Narang; ***@x-query.com; Murray, Gregory
Subject: Re: [xquery-talk] generate and schedule report

Thanks Joe!

Sent from my iPad

On May 29, 2014, at 1:56 PM, Joe Wicentowski <***@gmail.com> wrote:

>> I do not know of any module to generate an excel spreadsheet within eXist. You can read a spreadsheet using the content extraction function module.
>
> Pete Aven's article on generating Excel documents with XQuery is
> straightforward to apply in eXist-db:
>
> http://developer.marklogic.com/blog/smallchanges/2007-12-04
>
> (His whole series of articles is worth reading if you're interested in
> generating various Office documents with XQuery.)
>
> Joe






DISCLAIMER

The information transmitted, including any attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you receive this email by mistake, please advise the sender and delete it immediately. Email transmission cannot be guaranteed to be secure, or error free as information could be intercepted, corrupted, lost or destroyed as a result of the transmission process. Views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Please be aware that the Company monitors email communications through our networks for regulatory compliance purposes. NIIT Technologies Limited and its related entities consider the privacy of its clients to be of utmost importance and works to protect it. The Privacy Policy of the Company can be accessed from our website “www.niit-tech.com. (s).
Continue reading on narkive:
Loading...