Seal Report Forum
»
General
»
General Discussions/Other
»
Prompt for a parameter used in Pre Sql Script
Rank: Newbie
Groups: Registered
Joined: 8/5/2018(UTC) Posts: 0
|
Hi All,
I am new to this and need a help please....
My data is retrieved from running a stored procedure in Tables Pre Sql Script.... I am creating a temp table then calling a procedure with parameters to fill the table
Create Table #TmpTable .....etc
INSERT into #TmpTable EXECUTE dbo.MySP '123', '1/1/2018', '1/1/2018'
As you noticed the stored procedure parameters are fixed. I need a way to prompt a user to enter the stored procedure parameters before it gets excuted, as the SP is manipulating huge data and need to be filtered rather that using Restrictions in the Model.
Thanks and appreciate your assistance
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
Normally PreSQL script supports razor script if you start by @ You can check the samples 51 and 52 that show how to use a user input parameter in your script. Once you have defined a restriction in your model, use the Report reference set in your table.Source, your PreSQL Script may look like: Code:@using Seal.Model
@using Seal.Helpers
@{
MetaTable table = Model;
string sql = "YOUR SQL";
if (table.Source.Report != null)
{
ReportRestriction restriction = table.Source.Report.Models[0].GetRestrictionByName("you restriction name");
sql = string.Format("...", restriction.Date1);
}
//string result = string.Format("aColumnName={0}", Helper.QuoteSingle(restriction));
}
@Raw(sql)
Edited by user Sunday, August 12, 2018 12:05:14 AM(UTC)
| Reason: Not specified
|
|
|
|
Seal Report Forum
»
General
»
General Discussions/Other
»
Prompt for a parameter used in Pre Sql Script
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.