Hexagon Geospatial
MENU

Support GeoMedia Smart Client

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 47
Registered: ‎04-02-2017
Accepted Solution

IG.downloadReport script failing

[ Edited ]

Hi there,

 

I am using the following function in Javascript

 

IG.downloadReport = function(reportName, reportFormat, id){ 
var downloadUrl = IG.url('Form/DownloadReport')
.includeFormContext()
.urlParams({
'reportName':reportName,
'reportFormat':reportFormat,
'id':id
});
setTimeout(function(){window.reportBusy.close();},1000);

if(parent.window.SmartClient){
IG.downloadAndOpen(downloadUrl.toString({absolute: true})); //user to save to c:temp 
} else {
downloadUrl.redirectTo();
} 
};

to download a report I built. The first form in this workflow uses this for it's own report and works completely fine, but for the second report I built for a different form in this workflow I constantly get the following error from the log.

 

07.05.2018 14:30:43 ERROR - Controller Form has raised an exception in Action DownloadReport.
System.InvalidOperationException: Sequence contains no matching element
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at Intergraph.Emea.Data.Database.SelectById(DbDomainObjectMetadata metadata, Object id, DbConnection connection, DbTransaction transaction)
   at Intergraph.Emea.Data.Database.SelectById(DbDomainObjectMetadata metadata, Object id)
   at Intergraph.Emea.Workflows.FormController.DownloadReport(String reportName, String reportFormat)
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I have compared the forms - nothing stands out, rebuilt from scratch, experimented with the workflow and nothing seems to work. Are there any tricks with IG.downloadReport that I need to know about? I can't figure out what the problem is. Even if I add an incorrect report name the error occurs. Specifically it occurs on IG.downloadandOpen.

 

Regards,

 

Josh

Highlighted
Contributor
Posts: 47
Registered: ‎04-02-2017

Re: IG.downloadReport script failing

I removed the ID from the workflow action and it works now. Strange. It wasn't a problem in the other form.

 

action="SCRIPT[IG.downloadReport('SIMS_SummaryReport','pdf'),IG.closeWebBrowser()]"

was

action="SCRIPT[IG.downloadReport('SIMS_SummaryReport','pdf',{FORM.ID1}),IG.closeWebBrowser()]"
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.