Page 1 of 1
Unexpected Behaviour When Using Request Parameters = True
Posted: Mon Aug 19, 2013 9:28 am
by james.crossley
Hello
I've created a series reports using with the report parameter Request Parameters = True.
My users are prompted to select or enter Variables for the reports. The Variables are used in my SQL queries. This works as expected.
However, when debugging today, I noticed that when a report is loaded, the SQL query is executed BEFORE the Parameter/Variable panel is displayed.
This occurs in the Web Viewer and WebFx Viewer.
This produces an unnecessary trip to the database (query) and is undesirable because the user hasn't entered the parameters yet.
Is there a way I prevent the SQL query from occurring until the user enters variables and clicks the Submit button?
Thanks
James
Re: Unexpected Behaviour When Using Request Parameters = Tru
Posted: Mon Aug 19, 2013 12:10 pm
by HighAley
Hello.
Please, try to set the Request Parameters property of the report to True. Then SQL queries will be executed after requesting of the parameters.
Thank you.
Re: Unexpected Behaviour When Using Request Parameters = Tru
Posted: Mon Aug 19, 2013 8:49 pm
by james.crossley
Hi Aleksey
I have checked the reports, the report Request Parameters property is set to True.
The SQL queries are being executed before the requesting of the panel.
The version I'm using is Web 2013.2.1612
Re: Unexpected Behaviour When Using Request Parameters = Tru
Posted: Tue Aug 20, 2013 11:03 am
by HighAley
Hello.
If you need to disable SQL queries, please, set the Connect On Start of every Data Source to false and then in the Begin Render event Connect them.
Thank you.
Re: Unexpected Behaviour When Using Request Parameters = Tru
Posted: Wed Aug 21, 2013 9:24 pm
by james.crossley
Hi Aleksey
Thanks.
The version I'm using is Web 2013.2.1612 (Web and FX Viewers)
I can see how to set the Connect On Start of every Data Source to false, OK.
Please explain how I should Connect on the Begin Render event. Do I need to add Databand BeginRender event code inside the report for each databand and add a handler?
e.g.
Code: Select all
public void DataBandNAME__BeginRender(object sender, System.EventArgs e)
{
// what is the code to connect?
}
this.DataBandNAME.BeginRender += new System.EventHandler(this.DataBandNAME__BeginRender);
Thanks for your help
James
Re: Unexpected Behaviour When Using Request Parameters = Tru
Posted: Thu Aug 22, 2013 1:44 pm
by HighAley
Hello.
james.crossley wrote:Please explain how I should Connect on the Begin Render event. Do I need to add Databand BeginRender event code inside the report for each databand and add a handler?
You should to connect every necessary Data Sources in the Begin Render event of the report with Connect() method of each data source. For example,
Thank you.
Re: Unexpected Behaviour When Using Request Parameters = Tru
Posted: Wed Aug 28, 2013 7:26 am
by james.crossley
Hi Aleksey
Please excuse my ignorance. I'm unable to make this work. So far I have added a BeginRender method after the generated code as detailed below. I don't understand how it is called within the report. Do I need to add code to raise the BeginRender event? I assumed it would be called automatically.
Code: Select all
#endregion StiReport Designer generated code - do not modify
public void BeginRender(object sender, System.EventArgs e)
{
this.circuits.Connect();
this.contacts.Connect();
this.customer.Connect();
this.items.Connect();
this.jobs.Connect();
this.licensee.Connect();
this.notes.Connect();
}
Re: Unexpected Behaviour When Using Request Parameters = Tru
Posted: Wed Aug 28, 2013 11:37 am
by HighAley
Hello.
You should add the code on the Property Grid. Look at the attached image.

- BeginRenderWeb.png (12.14 KiB) Viewed 3191 times
Thank you.
Re: Unexpected Behaviour When Using Request Parameters = Tru
Posted: Wed Aug 28, 2013 9:42 pm
by james.crossley
Hi Aleksey
The screen shot was just what I needed. I was looking in all the wrong places!!!
Thank you VERY much for the help.
Regards
James
Re: Unexpected Behaviour When Using Request Parameters = Tru
Posted: Thu Aug 29, 2013 5:58 am
by Andrew
Hello,
We are always ready and glad to help you.
Thank you.