embed documents
embed documents
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
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
-
- Posts: 6272
- Joined: Tue Mar 20, 2018 5:34 am
Re: embed documents
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.
> 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
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'; ???
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'; ???
-
- Posts: 6272
- Joined: Tue Mar 20, 2018 5:34 am
Re: embed documents
Hello,
In PHP version, directly in the report, it is not possible, scripts in events are not supported.
Thank you.
In PHP version, directly in the report, it is not possible, scripts in events are not supported.
Thank you.
Re: embed documents
Hi,
I have managed to insert a page with images and also change the page orientation but cannot display a page number.
Thanks
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
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;
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;
-
- Posts: 6272
- Joined: Tue Mar 20, 2018 5:34 am
Re: embed documents
Hello
Ok.
Please let us know if you need any additional help.
Thank you.
Ok.
Please let us know if you need any additional help.
Thank you.
Re: embed documents
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
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
-
- Posts: 6272
- Joined: Tue Mar 20, 2018 5:34 am
Re: embed documents
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.
Please try to use the following code:
var event = new Stimulsoft.Report.Events.StiRenderingEvent();
event.script = 'this.addAnchor("SitePlan");';
databand1.renderingEvent = event;
Thank you.