Active Reports 14 API - Dinamically set url as a value on a RDLX report

Posted by: ricardo.pereira on 18 September 2020, 3:28 am EST

    • Post Options:
    • Link

    Posted 18 September 2020, 3:28 am EST

    Hi,

    Context:

    We have a rdlx report which has an image that gets generated through an api call like this:

    
    	<Image Name="Image1">
    		<DataElementName>Image1</DataElementName>
    		<Height>0.32cm</Height>
    		<Left>2.04895cm</Left>
    		<MIMEType>image/bmp</MIMEType>
    		<Sizing>Fit</Sizing>
    		<Source>External</Source>
    		<Value>[b]="http://localhost:5001/api/ReportImage/"[/b] &amp; Fields!Image1Data.Value</Value>
    		<Width>11.4992cm</Width>
    		<ZIndex>232</ZIndex>
    	</Image>
    
    

    This works fine locally because both the report and the api are on the same solution and running on http://localhost:5001.

    Problem:

    The problem we are facing is when we deploy the api and use a different url than “http://localhost:5001”. The call will still be made to “http://localhost:5001” which is obviously incorrect.

    Is there a way to dynamically set the URL so that we can change it per environment? I.e. One URL for staging and a completely different one for live.

    Best Regards,

    Ricardo Pereira

  • Posted 20 September 2020, 9:31 pm EST

    Hi,

    We solved this issue by adding a “BaseUrl” property to the dataset that fed the report and then referencing it on the tag.

    I don’t know how to delete this post or mark it as “solved” I would appreciate if you could close it for me.

    Best regards,

    Ricardo Pereira

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels