Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Different results by generating PDF-Documents
Different results by generating PDF-Documents [message #719208] Fri, 26 August 2011 08:02 Go to next message
juergenschaefer2000 is currently offline juergenschaefer2000
Messages: 5
Registered: August 2011
Junior Member
I try to hide the master footer when the page size is bigger then one. The Result is fine when I generate the PDF dokument from eclipse with the function "View Report as PDF". When I do the same from my code I get the footer on every page.

The following lines I use to hide the footer
if(pageNumber > 1){
this.getStyle().display ="none"
}

I use the Birt Runtime 3.7.0
To generate the pdf I use the following lines

IReportEngineFactory factory = (IReportEngineFactory) Platform
				.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
		// create a new report engine
		EngineConfig engineConfig = new EngineConfig();

IReportRunnable runnable = engine.openReportDesign("new_report.rptdesign");
			IRunAndRenderTask task = engine.createRunAndRenderTask(runnable);


PDFRenderOption option = new PDFRenderOption();
option.setOutputFileName("Tagesorder.pdf");
option.setOutputFormat(PDFRenderOption.OUTPUT_FORMAT_PDF);
task.setRenderOption(option);


Jürgen
Re: Different results by generating PDF-Documents [message #719271 is a reply to message #719208] Fri, 26 August 2011 10:56 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Do you have this script on the onRender? I just tried this with the RE
API and put it on the date text elements onRender event and it worked.

Jason

On 8/26/2011 8:02 AM, juergenschaefer2000 wrote:
> if(pageNumber > 1){
> this.getStyle().display ="none"
> }
Re: Different results by generating PDF-Documents [message #719338 is a reply to message #719208] Fri, 26 August 2011 14:30 Go to previous messageGo to next message
juergenschaefer2000 is currently offline juergenschaefer2000
Messages: 5
Registered: August 2011
Junior Member
Here is the Master-page Code
I put the code in the onRender Method.

Exciting is when I delete everything from my report and add the sample Datasource that everything works fine. But with my skripting datasource I got the failure that the footer is never hide. It works in Eclipse when I use "View Report as PDF" but my Problem is I can't try it out with my report because the Application opens a ssh connection and load the Data from a server and this does not funktion when I use the Eclipse integrated viewer. I belive that the integrated viewer use some other PDFRenderingOptions but I dont know what.

<simple-master-page name="Simple MasterPage" id="2">
			<property name="type">a4</property>
			<page-footer>
				<grid id="592">
					<method name="onRender"><![CDATA[if(pageNumber > 1){
 this.getStyle().display ="none"
 }]]></method>
					<column id="593" />
					<column id="594" />
					<column id="595" />
					<row id="596">
						<cell id="597">
							<label id="606">
								<text-property name="text">Gerät</text-property>
							</label>
						</cell>
						<cell id="598">
							<label id="607">
								<text-property name="text">Uhrzeit</text-property>
							</label>
						</cell>
						<cell id="599">
							<label id="608">
								<text-property name="text">Arbeiten</text-property>
							</label>
						</cell>
					</row>
					<row id="600">
						<cell id="601">
							<label id="609">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="610">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="611">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="612">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="613">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="614">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="615">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="616">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
						</cell>
						<cell id="602">
							<label id="617">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="618">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="619">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="620">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="621">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="622">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="623">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="624">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
						</cell>
						<cell id="603">
							<label id="625">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="626">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="627">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="628">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="629">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="630">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="631">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
							<label id="632">
								<property name="borderBottomColor">#000000</property>
								<property name="borderBottomStyle">solid</property>
								<property name="borderBottomWidth">thin</property>
							</label>
						</cell>
					</row>
				</grid>
			</page-footer>
		</simple-master-page>
Re: Different results by generating PDF-Documents [message #719393 is a reply to message #719338] Fri, 26 August 2011 17:52 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I tried this with the attached scripted data set report and could not
reproduce the issue. Do you have a way I could reproduce it?

Jason


On 8/26/2011 2:30 PM, juergenschaefer2000 wrote:
> Here is the Master-page Code
> I put the code in the onRender Method.
>
> Exciting is when I delete everything from my report and add the sample
> Datasource that everything works fine. But with my skripting datasource
> I got the failure that the footer is never hide. It works in Eclipse
> when I use "View Report as PDF" but my Problem is I can't try it out
> with my report because the Application opens a ssh connection and load
> the Data from a server and this does not funktion when I use the Eclipse
> integrated viewer. I belive that the integrated viewer use some other
> PDFRenderingOptions but I dont know what.
>
> <simple-master-page name="Simple MasterPage" id="2">
> <property name="type">a4</property>
> <page-footer>
> <grid id="592">
> <method name="onRender"><![CDATA[if(pageNumber > 1){
> this.getStyle().display ="none"
> }]]></method>
> <column id="593" />
> <column id="594" />
> <column id="595" />
> <row id="596">
> <cell id="597">
> <label id="606">
> <text-property name="text">Gerät</text-property>
> </label>
> </cell>
> <cell id="598">
> <label id="607">
> <text-property name="text">Uhrzeit</text-property>
> </label>
> </cell>
> <cell id="599">
> <label id="608">
> <text-property name="text">Arbeiten</text-property>
> </label>
> </cell>
> </row>
> <row id="600">
> <cell id="601">
> <label id="609">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="610">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="611">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="612">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="613">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="614">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="615">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="616">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> </cell>
> <cell id="602">
> <label id="617">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="618">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="619">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="620">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="621">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="622">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="623">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="624">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> </cell>
> <cell id="603">
> <label id="625">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="626">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="627">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="628">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="629">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="630">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="631">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> <label id="632">
> <property name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> </label>
> </cell>
> </row>
> </grid>
> </page-footer>
> </simple-master-page>
>
  • Attachment: sds.zip
    (Size: 1.25KB, Downloaded 60 times)
Re: Different results by generating PDF-Documents [message #719487 is a reply to message #719393] Sat, 27 August 2011 08:42 Go to previous message
juergenschaefer2000 is currently offline juergenschaefer2000
Messages: 5
Registered: August 2011
Junior Member
I resolved the Problem.
I made a beginner failure. When I run BIRT from a application the pagenumber will not be set with IRunAndRenderTask.
When I made the same with a seperate IRunTask and IRenderTask everything works fine.

Thanks a lot for your time.
Previous Topic:Report as a text file
Next Topic:stacked bar chart..
Goto Forum:
  


Current Time: Fri Aug 22 19:40:29 EDT 2014

Powered by FUDForum. Page generated in 0.10829 seconds