Web api with Angular use case with different urls

Stimulsoft Reports.WEB discussion
Post Reply
dino
Posts: 1
Joined: Wed Apr 08, 2020 7:25 pm

Web api with Angular use case with different urls

Post by dino »

So, I'm using more or less this,
just instead of Angular - it's plain Js.

Let's say API is at api.example.com, Js front at example.com/report.
On viewer I managed to get it working with static style in document and this "hack":

Code: Select all

Stimulsoft.Viewer.parameters.requestUrl = Stimulsoft.Viewer.parameters.requestAbsoluteUrl;
btw. useRelativeUrls is set to false.

On designer, I can't change the URL of loading images, which are referenced from CSS or dynamic Js I suppose.
And this one, which seems important:

Code: Select all

Designer?stiweb_component=Designer&stiweb_action=Resource&stiweb_cachemode=cache&stiweb_version=2020.2.1&stiweb_data=AllNotLoadedScripts

Regards.
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Web api with Angular use case with different urls

Post by Lech Kulikowski »

Hello,

You can use the stylesUrl and scriptsUrl options for the designer.
Also, we have added support to send the requestAbsoluteUrl option from the server side, it will be available in the next build.

Thank you.
swaraj
Posts: 7
Joined: Wed Feb 17, 2021 7:12 am

Re: Web api with Angular use case with different urls

Post by swaraj »

Capture1.JPG
Capture1.JPG (200.5 KiB) Viewed 1400 times
requestAbsoluteUrl, image Urls in Designer Get API response is coming as in the screenshot below. Is there any way to override it? It is not same as the url provided in the <stimulsoft-designer-angular [requestUrl]
Vadim
Posts: 362
Joined: Tue Apr 23, 2013 11:23 am

Re: Web api with Angular use case with different urls

Post by Vadim »

Hello.

You can access it in Designer (designerLoaded) event:
let viewerId = this.designer.designerEl.nativeElement.firstChild.jsObject.options.viewerId;
window["js" + viewerId + "Parameters"].options.requestAbsoluteUrl;
Post Reply