logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
fourfruit  
#1 Posted : Friday, May 11, 2018 3:01:22 AM(UTC)
fourfruit

Rank: Member

Groups: Registered
Joined: 1/18/2017(UTC)
Posts: 10
Taiwan, Province Of China
Location: Maoli

Thanks: 4 times
Dear Sirs,
I want to excute report with query values. For example , the sample report on site, named "Sear-Orders.srex".
When we use SWExecuteReport API to excute this report ,
how to pass specified date to set the default date of the restriction "Order Date" by code?
Thanks.
[img=https://imgur.com/a/qRJNurF]https://imgur.com/a/qRJNurF[/img]

epf  
#2 Posted : Saturday, May 12, 2018 7:10:02 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 527
Switzerland

Thanks: 7 times
Was thanked: 72 time(s) in 70 post(s)
Did you check http://demo.sealreport.org/WebInterfaceSamples.html

Here is the JavaScript to do it:
Code:
            $("#execute2_button")
                .click(function () {
                    $("#execute2_label").text("Executing 'Search - Orders' with custom restrictions...");
                    var form = $('<form method="post" target="_blank"/>').appendTo('body');
                    form.attr('action', sealServer + "SWExecuteReport");
                    form.append($('<input />').attr('name', 'path').attr('value', "\\Search - Orders.srex"));
                    form.append($('<input />').attr('name', 'r0_name').attr('value', "Quantity"));
                    form.append($('<input />').attr('name', 'r0_operator').attr('value', "Between"));
                    form.append($('<input />').attr('name', 'r0_value_1').attr('value', "34"));
                    form.append($('<input />').attr('name', 'r0_value_2').attr('value', "123"));
                    form.append($('<input />').attr('name', 'r1_name').attr('value', "Category"));
                    form.append($('<input />').attr('name', 'r1_operator').attr('value', "Equal"));
                    form.append($('<input />').attr('name', 'r1_enum_values').attr('value', "2,3,4,7"));
                    form.append($('<input />').attr('name', 'r2_name').attr('value', "Order Date"));
                    form.append($('<input />').attr('name', 'r2_operator').attr('value', "Equal"));
                    form.append($('<input />').attr('name', 'r2_value_1').attr('value', "19940809 00:00:00"));
                    form.append($('<input />').attr('name', 'r2_value_2').attr('value', "19940810 00:00:00"));
                    form.append($('<input />').attr('name', 'r2_value_3').attr('value', "19940811 00:00:00"));
                    form.append($('<input />').attr('name', 'r2_value_4').attr('value', "19940812 00:00:00"));
                    form.append($('<input />').attr('name', 'r3_name').attr('value', "Customer Contact"));
                    form.append($('<input />').attr('name', 'r3_operator').attr('value', "Contains"));
                    form.append($('<input />').attr('name', 'r3_value_1').attr('value', "ar"));
                    form.children('input').attr('type', 'hidden');
                    form.submit();
                });

Edited by user Saturday, May 12, 2018 7:10:44 AM(UTC)  | Reason: Not specified

thanks 1 user thanked epf for this useful post.
fourfruit on 5/12/2018(UTC)
fourfruit  
#3 Posted : Monday, May 14, 2018 12:46:22 AM(UTC)
fourfruit

Rank: Member

Groups: Registered
Joined: 1/18/2017(UTC)
Posts: 10
Taiwan, Province Of China
Location: Maoli

Thanks: 4 times
Thanks you!
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.