Jump to content
We've recently updated our Privacy Statement, available here ×

iReport 1.3.3 pdf export Margin settings Question


codyjasperForge

Recommended Posts

Hello all,

 

I am creating a report in iReport 1.3.3, and exporting it to AdobeReader. My report contains more than 8 subreports, however, when the report is exported, Adobe changes each of the subreports' margin settings. Each subreport gets shifted to the right margin within Adobe. Yet when I export to JRViewer, the display seems to be fine. My main report properties are set to Letter orientation with 1" margins for left and right. Each subreports' margin settings are all set to 0".

 

Can anyone help me with this? I have read extensively throughout the forum, yet I haven't found any clausable solutions to this problem. It is becoming increasingly important for me to solve this problem(I am pressed for time) PLEASE, ANYONE?!

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

*bump*

 

Also,

 

I am having trouble compiling my report when attempting to use the scriptlet editor. I keep getting the same error: ClasNotFoundException...

 

I am using the internal scriptlet editor in iReport 1.3.3. I have included tools.jar in my classpath, I have also tried moving the .class file throughout the iReport directory, but I still get the same result. Surely someone has an answer for me!?

 

Any information regarding either of the previous posts would be more than appreciated. Thanks people...

Link to comment
Share on other sites

Hi,

 

When you are using internal scriptlet editor, ireport save the java and class file in the same directory where the jrxml file stored. So it is neccessary to have jrxml file in the same folder where scriptlet.java file exist, if your are compiling the jrxml file later.

 

One more thing, if the scriptlet is handled internally by iReport, when the report is compiled, a new

class with the same name as the report, followed by the postfix “Scriptlet.java†is

created. For example, if you have a report named test, the generated scriptlet file

will be named testScriptlet.java.

 

Where are using the scriptlet in report?

 

Aditya

Link to comment
Share on other sites

Hi,

 

When you are using internal scriptlet editor, ireport save the java and class file in the same directory where the jrxml file stored. So it is neccessary to have jrxml file in the same folder where scriptlet.java file exist, if your are compiling the jrxml file later.

 

One more thing, if the scriptlet is handled internally by iReport, when the report is compiled, a new

class with the same name as the report, followed by the postfix “Scriptlet.java†is

created. For example, if you have a report named test, the generated scriptlet file

will be named testScriptlet.java.

 

Where are using the scriptlet in report?

 

Aditya

Link to comment
Share on other sites

Hi,

 

When you are using internal scriptlet editor, ireport save the java and class file in the same directory where the jrxml file stored. So it is neccessary to have jrxml file in the same folder where scriptlet.java file exist, if your are compiling the jrxml file later.

 

One more thing, if the scriptlet is handled internally by iReport, when the report is compiled, a new

class with the same name as the report, followed by the postfix “Scriptlet.java†is

created. For example, if you have a report named test, the generated scriptlet file

will be named testScriptlet.java.

 

Where are using the scriptlet in report?

 

Aditya

Link to comment
Share on other sites

I am using the scriptlet within a textfield. I am calling the scriptlet's public method from a String field inside of my textfield expression. I have followed the syntax of the scriptlet example in JasperReports->samples but, the 'ClassNotFoundException' keeps occuring. I have tried saving the actual .java file inside of my /reports directory, (where the other .jrxml files are located) but to no avail. Any other possibilities? Thanks for the reply : )
Link to comment
Share on other sites

Hi,

 

Fine do following steps.

 

1. Open the ireport with your report too.Say the report name is "myreport"

 

2. Goto Edit->reportPropeties->select scriptlet class tab and then choose ireport internal scriptlet editor from scriptlet class drop down menu. Choose language as java.

 

3. click ok.

 

4. Now got scriptlet editor, write your public method below the constructor. for example, method name is "numberToRoman".

 

5. save it and exit.

 

6. Now whereever you are calling this method, use this expression.

 

(((myreportScriptlet)$P{REPORT_SCRIPTLET}).numberToRoman(<method_parameter>))

 

7. Dont move the myreportScriptlet.java and class file where ever it creates.

 

8. compile and run.

 

It will run the report without any error.

 

Try these steps. Iam sure there is no error and report will run fine.

 

Aditya

Link to comment
Share on other sites

I have followed the steps that you defined, yet I still get the following error returned when attempting to compile:

 

F:JasperReportsreportsSoftCpyA_P_Disposition_Letter_subreport0Scriptlet.java:4:

class ScriptletTest is public, should be declared in a file named ScriptletTest.java public class ScriptletTest extends it.businesslogic.ireport.IReportScriptlet { ^ 1 error

 

The .java file is where it is supposed to be... I'm really at a loss here. Any other ideas?

Link to comment
Share on other sites

Hi,

 

Are you using internal scriptlet editor or external scriptlet class?

 

If you are using internal scriptlet editor then you dont have to change the name of clas. It is taken by the ireport by default. see if you go to scriptlet editor, you see this type of code,

 

import net.sf.jasperreports.engine.*;

 

 

public class <ScriptletClassName> extends it.businesslogic.ireport.IReportScriptlet {

 

/** Creates a new instance of JRIreportDefaultScriptlet */

public <ScriptletClassName>() {

 

}

}

 

So in this code <scriptletclassname> is automatically set at compile time by the ireport, you dont have to change it.

 

If you are using external scriptlrt class , then choose option ' use this scriptlet class' from report properties option in edit menu and provide the fully classified claas path to text box below to 'use this scriptlet class' option.

 

The class should be added in ireport classpath. Goto option menu and then select classpath.

 

I think this may the solution to your problem.

 

Aditya

Link to comment
Share on other sites

aditya_gupta,

 

Thanks for the replies. I have come to the realization that the mistake was in my <ScriptletClassName>. As always, in Java you class name must match the filename, which was not the case in my situation. I have made the necessary changes and the scriptlet works now. Once again I thank you for your time.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...