Unexpected Behaviour When Using Request Parameters = True
-
- Posts: 28
- Joined: Sun Aug 07, 2011 8:53 pm
- Location: Auckland
Unexpected Behaviour When Using Request Parameters = True
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
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
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.
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.
-
- Posts: 28
- Joined: Sun Aug 07, 2011 8:53 pm
- Location: Auckland
Re: Unexpected Behaviour When Using Request Parameters = Tru
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
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
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.
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.
-
- Posts: 28
- Joined: Sun Aug 07, 2011 8:53 pm
- Location: Auckland
Re: Unexpected Behaviour When Using Request Parameters = Tru
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.
Thanks for your help
James
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
Hello.
Thank you.
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,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?
Code: Select all
YourDataSourceName.Connect();
-
- Posts: 28
- Joined: Sun Aug 07, 2011 8:53 pm
- Location: Auckland
Re: Unexpected Behaviour When Using Request Parameters = Tru
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.
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
Hello.
You should add the code on the Property Grid. Look at the attached image. Thank you.
You should add the code on the Property Grid. Look at the attached image. Thank you.
-
- Posts: 28
- Joined: Sun Aug 07, 2011 8:53 pm
- Location: Auckland
Re: Unexpected Behaviour When Using Request Parameters = Tru
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
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
Hello,
We are always ready and glad to help you.
Thank you.
We are always ready and glad to help you.
Thank you.