Aller au contenu principal

Mutiple feature attachments must support non images.

Commentaires

1 commentaire

  • Zack Robison

    Getting just a hyperlink to a the hosted file would be very helpful.

    To the people of the future, I made myself a list of hyperlinks using Workflow.  I use a Rich Text element in a Report with a custom object containing HTML for each attachment link using the given feature ID as a binding.  Here's a general overview of the process:

    In Workflow: you can use a Query Attachment Infos activity to create attachment links for any given feature.  Nest this link generation in a For Each activity that loops over the features which will be sent to the Report.  Create an empty object and use it to hold an array of all your links in the format indicated below, then send that object to the report as a runtime input along with your FeatureIDs.  In my case, I also used another property to determine whether to display the report element which contains the links for each feature, but that's unnecessary.

    {
    	oid1: {
    		display: true,
    		linkHtml: '<p><a href="link1">attachment title 1</a></p> <p><a href="link2">attachment title 2</a></p>']
    	},
    	oid2: {
    		display: true,
    		linkHtml: '<p><a href="link3">attachment title 3</a></p>'
    	},
    	oid3: {
    		display: false
    	}
    }

    In Reporting, I have a Rich Text element in the report Detail band to accept these links.  Since each feature ID is available in the detail, you can use the builtin Criteria function GetJsonValue() to bind to the links for a that given feature as seen below, throw this in the HTML expression and you should be good to go.  I did something similar in the Visible expression.

    GetJsonValue( ?AttachmentLinks , '$.'+[OBJECTID]+'.linkHtml') 

    Hope this helps someone, took me a bit of time to get it all figured out but we needed it so here it is!  Of course, this could have probably been done natively using the builtin Reporting expression editor but for this project I'm trying to be as out-of-the-box as possible.

    0

Vous devez vous connecter pour laisser un commentaire.