Page 1 of 1

StiDatePickerShow is not defined

Posted: Tue Oct 30, 2012 2:12 pm
by JoshR
Hi,

I'm using the trial version of Stimulsoft.Reports.Web 2012.2 to put together a test application to see if it's suitable for our requirements.

One of our requirements is that it works with our current set of reports. Some of those reports use dialog boxes, and have datepickers on the dialogs.

When running those reports, I'm getting a javascript error:

Code: Select all

ReferenceError: StiDatePickerShow is not defined

StiDatePickerShow(this, "yyyy/mm/dd");
I have the following on my page:

Code: Select all

<Sti:StiWebViewer ID="viewer" runat="server" Visible="false" />
And in my code behind am calling the following when generating the report:

Code: Select all

public void LoadReport(Report model)
{
	var report = new StiReport();
	report.Load(model.Path);

	if (IsValidReport(report.GetComponents()))
	{
		string filter = this.FilterValue;

		foreach (StiSqlDatabase database in report.Dictionary.Databases)
		{
			database.ConnectionString = ConfigurationManager.ConnectionStrings["Connstr"].ConnectionString;
		}

		
		if (!string.IsNullOrEmpty(filter))
		{
			foreach (StiDataSource dataSource in report.Dictionary.DataSources)
			{
				string query = ((StiSqlSource) dataSource).SqlCommand;

				((StiSqlSource) dataSource).SqlCommand = query.Replace("('%wc%' = '%wc%')",
																	   string.Format("({0} IN ({1}))",
																					 model.KeyWord,
																					 filter));
			}
		}

		this.viewer.Report = report;
		this.viewer.ProcessReport();
		this.viewer.Visible = true;
	}
	else
	{
		this.InvalidReportErrorVisible = true;
	}
}

private static bool IsValidReport(StiComponentsCollection components)
{
	bool isValidReport = true;

	var invalidControlTypes = new List<Type>
								  {
									  typeof (StiGroupBoxControl),
									  typeof (StiGridControl),
									  typeof (StiPictureBoxControl),
									  typeof (StiCheckedListBoxControl),
									  typeof (StiLookUpBoxControl),
									  typeof (StiNumericUpDownControl),
									  typeof (StiListViewControl),
									  typeof (StiTreeViewControl)
								  };

	foreach (StiComponent component in components)
	{
		Type type = component.GetType();

		foreach (Type invalidType in invalidControlTypes)
		{
			if (type == invalidType)
			{
				isValidReport = false;
			}
		}
	}

	return isValidReport;
}
Am I missing something from my page? A reference to some web or script resources? Reports without datepickers work just fine.

Re: StiDatePickerShow is not defined

Posted: Wed Oct 31, 2012 7:58 am
by Alex K.
Hello,

Can you please send us a sample project which reproduces the issue for analysis.

Thank you.

Re: StiDatePickerShow is not defined

Posted: Mon Nov 12, 2012 10:04 am
by JoshR
Hi Aleksey,

Sorry this took so long to get to you, please see the attachment. Let me know if you have any problems running the solution.

Re: StiDatePickerShow is not defined

Posted: Mon Nov 12, 2012 1:36 pm
by HighAley
Hello.

You should use the RenderMode="AjaxWithCache" of the StiWebViewer.

Thank you.

Re: StiDatePickerShow is not defined

Posted: Mon Nov 12, 2012 2:32 pm
by JoshR
Hi Aleksey,

I've changed that in the example solution I sent you, and I still get the error. Any thoughts?

Thanks.

Re: StiDatePickerShow is not defined

Posted: Tue Nov 13, 2012 6:48 am
by HighAley
Hello.

We made an improvement.
The solution will be available in our next prerelease build from November 16.

Thank you.

Re: StiDatePickerShow is not defined

Posted: Tue Nov 13, 2012 9:37 am
by JoshR
Hi Aleksey,

Can you tell me which release this will be in?

Thanks again :)

Re: StiDatePickerShow is not defined

Posted: Wed Nov 14, 2012 7:37 am
by HighAley
Hello.
JoshR wrote:Can you tell me which release this will be in?
As I wrote before, the solution will be available in our next prerelease build from November 16.

Thank you.