logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


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

Notification

Icon
Error

Options
Go to last post Go to first unread
RamKumar  
#1 Posted : Thursday, May 31, 2018 12:47:05 PM(UTC)
RamKumar

Rank: Newbie

Groups: Registered
Joined: 5/31/2018(UTC)
Posts: 1
India
Location: Hyderabad

We have developed a web application in .NET in which we integrated seal reports. When we login to .NET web application using an USERNAME and password, the seal report should show the data related to that particular user who has login. So, how to pass user parameter from web application to SQL query in seal report?
We have tried "Additional WHERE" clause and "Init script" but unable to link parameter with seal report.
Please give us solution for this.




Thanks & regards,
RamKumar

Edited by user Thursday, May 31, 2018 12:50:25 PM(UTC)  | Reason: Not specified

epf  
#2 Posted : Thursday, May 31, 2018 1:11:02 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
RamKumar  
#3 Posted : Thursday, May 31, 2018 2:45:03 PM(UTC)
RamKumar

Rank: Newbie

Groups: Registered
Joined: 5/31/2018(UTC)
Posts: 1
India
Location: Hyderabad

Thanks for your quick reply but it not helped us. I am describing the scenario again -

We have MVC application and from there we are calling Seal Report(in iFrame control). Report is loading correctly in iFrame.
We want to pass 3 parameters namely UserId(logged in user), BaselineID(Category) and Counter(who gets number of records).

We tried below code in MVC application where we tried to pass UserId as a single parameter.
But seems that that is not getting captured in Seal Report as data is not filtering when we ran the report.

var user = localStorage.getItem("userID");
var baselineID = this.serverTypeId;
if (this.selectedValue == "") { this.selectedValue = "5"; }
var selectedCount = this.selectedValue;

var sealServer = "http://192.168.10.54/seal/";
var form = $('<form method="post" target="Companyiframe" />');
form.attr('action', sealServer + "SWExecuteReportToResult");

form.append($('<input />').attr('type', 'hidden').attr('name', 'path').attr('value', "\\Newreport - Copy.srex"));

form.append($('<input />').attr('name', 'UserId').attr('value', "UserId"));
form.append($('<input />').attr('name', 'Operator').attr('value', "Contains"));
form.append($('<input />').attr('name', 'r0_value_1').attr('value', user));

//form.append($('<input />').attr('type', 'hidden').attr('name', 'user').attr('value', user));
//form.append($('<input />').attr('type', 'hidden').attr('name', 'baselineID').attr('value', baselineID));
//form.append($('<input />').attr('type', 'hidden').attr('name', 'selectedCount').attr('value', selectedCount));

form.children('input').attr('type', 'hidden');
$('body').append(form);
form.submit();

Here is link for report we designed and called in MVC application
- https://drive.google.com...b4QX93M/view?usp=sharing

I would appreciate your quick reply as we are new to Seal Report and struggling at the moment.
epf  
#4 Posted : Thursday, May 31, 2018 3:20:55 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
For this, I would imagine that your target report must have at least a model having prompted restrictions...with the good names.

Did you check the sample from https://sealreport.org/d...ebInterfaceSamples.html:

Code:
                   var form = $('<form method="post" target="_blank"/>').appendTo('body');
                    form.attr('action', sealServer + "SWExecuteReportToResult");
                    form.append($('<input />').attr('name', 'path').attr('value', "\\Search - Orders.srex"));
                    form.append($('<input />').attr('name', 'format').attr('value', "html"));
                    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();
Users browsing this topic
Guest (2)
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.