8.1.3 - Web Portal - Dynamically Preview/Embed Non-List Reports

Hi Forum,

I've got a customer requirement to be able to "preview" reports in the web portal. Both list reports and non-list reports.

List report preview is available OOTB which is fantastic but the customer would like to also be able to preview non-list reports.

To do this i have copied and modified the web portal code used for list reports RPS_ListReports, RPS_ListReport_Form and RPS_ListReport.

Once a user enters the report details I've got a code snippet to generate the report using the below (if it isn't a list report).

string _pdfTempFileName1 = System.IO.Path.Combine(_UserSession.GetTempPath(), (_uid1.GetValue(this.Vars.SingleRow).String + "_PDF"));
                    System.Collections.Generic.Dictionary<string, object> _parameters1 = new System.Collections.Generic.Dictionary<string, object>();
					#if DEBUG
                    VI.WebRuntime.Debugger.InterruptManager.Instance.NotifyExecute("CCC_Report", "ForeachRow1", this.TableStore, _Module);
                    #endif
                    System.Collections.Generic.IEnumerator<VI.WebRuntime.RowCursor> _enumerating1 = new VI.WebRuntime.RowCursorList(this.DialogParameter).GetEnumerator();
                    for (int _rowIndex1 = 0; _enumerating1.MoveNext(); _rowIndex1 = (_rowIndex1 + 1))
                    {
						VI.WebRuntime.RowCursor ForeachRow1_Current = _enumerating1.Current;
						
						VI.WebRuntime.IDataColumn _ParameterNameCol = this.DialogParameter.GetColumn("ParameterName");
						string parameterName = _ParameterNameCol.GetValue(ForeachRow1_Current.Row).String;
						
						VI.WebRuntime.IDataColumn _ParameterValueCol = this.DialogParameter.GetColumn("ParameterValue");
						object parameterValue = _ParameterValueCol.GetValue(ForeachRow1_Current.Row);
						if (parameterValue == null)
                   			{
                        	VI.WebRuntime.IDataColumn _ParameterValueDefaultCol = this.DialogParameter.GetColumn("DefaultValue");
							parameterValue = _ParameterValueDefaultCol.GetValue(ForeachRow1_Current.Row);
                    		}
                        _parameters1.Add(parameterName,parameterValue);                         
                    }	
					
                    VI.WebRuntime.IDataRow _row5 = this.Report.FirstOrDefault();
                    object _result3 = default(object);
                    if (_row5 != null)
                    {
                        string _tmpstring1 = "FK(UID_DialogReport).ReportName";
                        _result3 = ((VI.WebRuntime.IDbObjectRow)(_row5)).GetObjectWalker<object>(_tmpstring1);
                    }
                    Stimulsoft.Report.StiReport _report1 = new VI.WebRuntime.Data.ReportBuilder(_UserSession.UserDataConnection.Session).CreateReport(_result3.ToString(), _parameters1);
                    _UserSession.SessionObjects[_uid1.GetValue(this.Vars.SingleRow).String] = _report1;

The system then re-directs to the generic VI_Common_ShowReport

Unfortunately the parameterValue stored in DialogParameter doesn't look to the be the right type of value to set.

On the 'user account operations' report for example I'm seeing errors such as

An exception has occurred while executing the form method F0_ctl00_ControlRef8_ControlRef15_ControlRef15_ControlRef8b_Main_Main_R0_ControlRef1_Container5_Button1_Method.
Last365Days is not a valid date range type.
(2020-11-25 18:51:06)

Thoughts/ideas?

Thanks!