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: 46
Registered: ‎06-18-2018

Generate Report Form.CreateForm Method failing

Hi,

 

In one of our custom workflow functionality for generating report, it is failing at method
"Form.CreateForm". GMSC version is 2018. Same functionality is working in v 2015 and 2016. Please
let me know is it a known problem. and let us know if you require any additional things from us.

 

Thanks & Regards,
Anil

Staff
Posts: 609
Registered: ‎11-12-2015

Re: Generate Report Form.CreateForm Method failing

Hi Anil,

 

Further information on the error coming from the log file would be beneficial here.

Without additional information it is difficult to say if this is a known issue.

For more in depth investigation you may also wish to open this as a support ticket.

 

HTH

Contributor
Posts: 46
Registered: ‎06-18-2018

Re: Generate Report Form.CreateForm Method failing

Hi,

 

Below code we are using to render report.

 

public override void Execute()
{
FormDescription currentFormDescription = null;
if (string.IsNullOrEmpty(FormName))
{
WorkflowNodeDescription currentNode = WorkflowControllerContext.DescriptionProvider.GetWorkflowNodeDescription(WorkflowControllerContext.RequestProvider.GetQueryString()[QueryStringNames.NodeId], WorkflowControllerContext.Workflow);
currentFormDescription = WorkflowControllerContext.DescriptionProvider.GetFormDescription(currentNode.Form, WorkflowControllerContext.Workflow);
}
else
currentFormDescription = WorkflowControllerContext.DescriptionProvider.GetFormDescription(FormName, WorkflowControllerContext.Workflow);

DomainObject domainObject = null;
if (!string.IsNullOrEmpty(currentFormDescription.IdField) && WorkflowData.Contains(PlaceholderType.Form, currentFormDescription.IdField))
domainObject = WorkflowControllerContext.GetDatabase().SelectById(GetDomainObjectMetadata(currentFormDescription), WorkflowData.GetValue(PlaceholderType.Form, currentFormDescription.IdField));
Form currentForm = Form.CreateForm(currentFormDescription, WorkflowControllerContext, WorkflowData, domainObject, ModelScopes.Report);
ReportResult renderedReport = WorkflowControllerContext.ReportProvider.RenderReport(ReportName, string.IsNullOrEmpty(ReportFormat) ? "pdf" : ReportFormat, currentFormDescription, new List<Form>() { currentForm }, new List<WorkflowData>() { WorkflowData });
using (FileStream fs = new FileStream(Path.Combine(ReportDirectory, TargetReportName + "." + ReportFormat), FileMode.Create))
{
fs.Write(renderedReport.Data, 0, renderedReport.Data.Length);
Log.DefaultLog.Debug("Create single file");
}

Log.DefaultLog.Debug("Files completed");
}

 

But highligted in red, giving an alert error for a split seconds as "Unable to generate report". It reaches highlighted in blue. After that it calls, javascript fail area below and throwing custom error as "Unable to Generate PDF, Contact Admin" :

 

setTimeout(function(){
IG.trigger({triggerNames:['trgLDGen']}).done(function(){
}).fail(function(){
busyDialog.close();
alert('Unable to Generate PDF, Contact Admin');
return;
});

 

 

The same code is working in earlier version. We are using version 2018 (16.5.316.4)

 

Regards,

Anil

 

Contributor
Posts: 46
Registered: ‎06-18-2018

Re: Generate Report Form.CreateForm Method failing

Hi,

 

Further to above trail, just like to inform that the pdf is generating in the location.

However, it is not opening up. Instead throwing error as above.

 

Regards,

Anil

Staff
Posts: 1,036
Registered: ‎10-18-2015

Re: Generate Report Form.CreateForm Method failing

Hi Anil,

 

the way reports get generated has not changed. What has changed is the Javascript API to open and download the media. Do you have any other part of the script involved? Can you please check your custom scripts are up to date with the following tutorial?

http://community.hexagongeospatial.com/t5/GMSC-Tutorials/Javascript-API/ta-p/25119

 

If you can debug your solution and you cannot find what is causing the error please log a support ticket.

 

Thanks,

Stefano

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