Page 1 of 1

embed documents

Posted: Mon Sep 03, 2018 12:09 am
by riskcom
Hi,

I was asked to embed PDF files into a report if possible.

If not, I could export PDF files to images. Is it possible to insert images on the fly and also change the page orientation?

Thanks
Leo

Re: embed documents

Posted: Mon Sep 03, 2018 8:17 am
by Lech Kulikowski
Hello,

> I was asked to embed PDF files into a report if possible.

It is not possible.

> If not, I could export PDF files to images. Is it possible to insert images on the fly and also change the page orientation?

In PHP version, directly in the report, it is not possible, scripts are not supported. Only from code:
https://www.stimulsoft.com/en/samples/j ... -from-code

Thank you.

Re: embed documents

Posted: Tue Sep 04, 2018 12:05 am
by riskcom
Thanks Lech!

How about use the "Render Events"? As we read images from JSON and can give a parameter to specify the orientation of the image.

Rendering --> this.Orientation = 'Landscape'; ???

Re: embed documents

Posted: Thu Sep 06, 2018 7:51 am
by Lech Kulikowski
Hello,

In PHP version, directly in the report, it is not possible, scripts in events are not supported.

Thank you.

Re: embed documents

Posted: Fri Sep 07, 2018 4:00 am
by riskcom
Hi,
I have managed to insert a page with images and also change the page orientation but cannot display a page number.
Thanks

Re: embed documents

Posted: Fri Sep 07, 2018 4:16 am
by riskcom
var report = new Stimulsoft.Report.StiReport();
report.loadFile("reports/Report.mrt");
--- LOOP ---
var treport = new Stimulsoft.Report.StiReport();
var tpage = treport.pages.getByIndex(0);
tpage.orientation = 1;
--- add image component ----
--- add Page Number ----
var txt = new Stimulsoft.Report.Components.StiText();
txt.text = "{PageNumber}";
tpage.components.add(txt);
report.pages.insert(8, tpage);
--- END LOOP ---
viewer.report = report;

Re: embed documents

Posted: Fri Sep 07, 2018 7:36 am
by Lech Kulikowski
Hello

Ok.
Please let us know if you need any additional help.

Thank you.

Re: embed documents

Posted: Mon Sep 10, 2018 1:52 am
by riskcom
Hi,

Sorry to be a pain.

We need to update the TOC after inserting images from code.

So I added the databand with the following:
var databand1 = new Stimulsoft.Report.Components.StiDataBand();
databand1.name = "SitePlanDB";
databand1.renderingEvent.script = 'this.addAnchor("SitePlan");';
report.pages.getByIndex(8).components.add(databand1);

However, we are not able to the page number with {GetAnchorPageNumber("SitePlan")}???

Thanks

Re: embed documents

Posted: Tue Sep 11, 2018 10:09 am
by Lech Kulikowski
Hello,

Please try to use the following code:
var event = new Stimulsoft.Report.Events.StiRenderingEvent();
event.script = 'this.addAnchor("SitePlan");';
databand1.renderingEvent = event;

Thank you.