Hexagon Geospatial
MENU

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
Highlighted
Contributor
Posts: 66
Registered: ‎05-03-2016

Outputting a Form Report using a Javascript Action

Hi, is there an alternate way of outputting a report in GMSC, rather than using the FormReport action in the workflow?


I have a requirement to allow a user to click a button on a particular tab which will create a report that is only based on the form table on this tab.

Currently I only know of the formreport action which is placed at the start of the form and only appears at the top right.

 

Also, is there a way to automatially save the report without the user needing to click save? I imagine that would be a security issue if allowed.


Regards,

 

Josh

Contributor
Posts: 31
Registered: ‎12-14-2016

Re: Outputting a Form Report using a Javascript Action

Hi

 

You can define a custom action instead of using the report button on the top right of your form. You need the same basis (Telerik report) but you can start the report creation from any action in your form and pass the respective parameters.

 

This is an example from an older version of workflow manager, but I think it will still work:

 

FormSettings:

<FormAction name="DownloadReport" visible="list" type="row" action="SCRIPT[JobManagement.downloadReport('JobManagement','pdf', )]" image="jobManagement-icon-pdf"/>

 

Javascript&colon;

JobManagement.downloadReport = function(reportName, reportFormat, id){
    window.reportBusy = IG.busy();
    var downloadUrl = IG.url('Form/DownloadReport')
                .includeFormContext()
                .urlParams({
                    'reportName': reportName,
                    'reportFormat': reportFormat,
                    'id':id
                });            
                
                setTimeout(function(){window.reportBusy.close();},1000);
                if(window.SmartClient){
                    IG.downloadAndOpen(downloadUrl.toString({ absolute: true }));
                }else{
                    downloadUrl.redirectTo();
                }
}

 

Hope it helps

Regards

Frequent Contributor
Posts: 91
Registered: ‎04-03-2017

Re: Outputting a Form Report using a Javascript Action

That has worked well.


Thanks for that.

I'll incorporate that with the SQL email functionality.

Frequent Contributor
Posts: 91
Registered: ‎04-03-2017

Re: Outputting a Form Report using a Javascript Action

Are these functions documented anywhere as it would be good to know what each function does.

 

I have it working but I would like to be able to have the save location set to our GMSC server by default if possible, instead of the Temp directory on the users machine. This is so a SQL trigger can attach the report to an email, as it can grab it from the server.

 

Regards,

 

Josh

Staff
Posts: 951
Registered: ‎10-19-2015

Re: Outputting a Form Report using a Javascript Action

Hi Josh,

 

the Javascript API is documented here, but I'm not sure this particular method is part of the published ones.

The download report action is a client side action, so you cannot upload the file directly to the server. You would need to combine it with a trigger using a formfile field to store the results into the database. So I guess you should be able to create your custom javascript action with included download report and trigger actions.

 

HTH,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Polls
Please register to vote
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.