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
mdiknash  
#1 Posted : Sunday, August 5, 2018 6:53:08 AM(UTC)
mdiknash

Rank: Newbie

Groups: Registered
Joined: 8/5/2018(UTC)
Posts: 0
Jordan

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
epf  
#2 Posted : Sunday, August 12, 2018 12:04:16 AM(UTC)
epf

Rank: Administration

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

Thanks: 14 times
Was thanked: 205 time(s) in 198 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

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.