cancel
Showing results for 
Search instead for 
Did you mean: 

Couldn't print without margins

Former Member
0 Kudos

Hi,

I am printing reports with CR4E.

The reports are designed with zero margins, but are printed or viewed with margins.

Printing inside Crystal Reports the same reports the result is without margins (margins ok).

-


Versions are:

com.businessobjects.sdks.jrc.11.8.0_11.8.5.v1197

com.businessobjects.integration.eclipse.library_1.0.5.v1197

com.businessobjects.sdks.jrc.11.8.0_11.8.5.v1197

Thank's.

Victor Sempere

Accepted Solutions (0)

Answers (2)

Answers (2)

ted_ueda
Employee
Employee
0 Kudos

Hello Victor,

It appears to export without margins on my CR4E.

One note - if you're viewing the report in the ReportViewerBean JApplet, it'll display a thin region around the report that's not part of the page or margin.

Usually to debug page margin and object suppression issues, I put text objects with borders right at the edge of the report, to mark the page boundaries.

Sincerely,

Ted Ueda

Former Member
0 Kudos

Hello Ted,

First of all, thank you for your help.

I don't know where are you exporting the report.

I have the problem only when I send the report to the

printer, because I tried to export to PDF and it works

well but then I couldn't print the PDF because the library I use

gives me an internal nullpointerexception.

I made a report with lines around the edge of the page (report's margins are set to 0) and the ReportViewer shows a margin and that margin is part of my report because when I print it, this margin is printed.

Please, could you try to print an report and says to me if

you get the same problem? Or if you couldn't do you know another

way to get this report printed?

Thank's.

Victor

ted_ueda
Employee
Employee
0 Kudos

Hello Victor,

Current status - I see the issue specific to printing, where zero margins aren't respected and the report content is offset to the right and bottom, causing truncation.

This affects printing both from the ReportViewerBean thick-client viewer and PrintOutputController print methods.

This doesn't affect export.

I haven't found a workaround - other than exporting to another format, such as PDF, and printing that.

I'll keep updating this thread.

Thanks for identifying this issue!

Sincerely,

Ted Ueda

ted_ueda
Employee
Employee
0 Kudos

OK - further update.

I was getting inconsistent results as to whether I could print without page margins.

I spoke with Graham on the Business Objects - Crystal Reports Design side of things, and here's what I found.

Crystal Reports formats reports specific to the metrics provided by the Printer specified. Most printers out there do not support zero margins, since they're unable to print on the entire page.

"No Printer" setting on Crystal Reports also do not support zero margins - there's always going to be a small margin that you can't remove (something like 0.166 in).

Crystal Report Designer does not allow you to set zero margins if the printer does not.

It's a bug that Crystal Reports for Eclipse allow you to set zero margins. This zero margin is respected when you export, however, when you try and print, it tries to work with the non-zero margin, thereby offsetting the report to the right and bottom.

Gist of this is that you should not set page margins to zero in Crystal Reports for Eclipse.

Sincerely,

Ted Ueda

Former Member
0 Kudos

Hi,

Could you be more specific on how you are printing? Are you printing from Eclipse interface, using java code in an application, etc..

Just to make sure, are you printing from the same machine, to the same printer using the same driver?

Cheers,

David

Former Member
0 Kudos

Hello,

I'm using Java code from my application.

I use the classes: ReportClientDocument and ReportViewer, as in the sample attached.

The report is designed in the eclipse's designer, and the margins left and top are set to 0 in this designer.

With the ReportViewer always shows and prints a magin, while the same reports open in Crystal Reports XI don´t show de margins.

Thank's.

Victor.

Sample code (2 files)

-

-


import javax.swing.*;

import com.crystaldecisions.reports.sdk.ReportClientDocument;

import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;

public class JRCViewReport

{

private static final String REPORT_NAME = "Report1.rpt";

public static void launchApplication()

{

try {

//Open report.

ReportClientDocument reportClientDoc = new ReportClientDocument();

reportClientDoc.open(REPORT_NAME, 0);

//Launch JFrame that contains the report viewer.

new ReportViewerFrame(reportClientDoc);

}

catch(ReportSDKException ex) {

System.out.println(ex);

}

catch(Exception ex) {

System.out.println(ex);

}

}

public static void main(String [] args)

{

SwingUtilities.invokeLater(new Runnable() {

public void run() {

//Hand-off to worker function to start application.

launchApplication();

}

});

}

}

/*----

-


-

-


*/

import com.crystaldecisions.ReportViewer.*;

import com.crystaldecisions.reports.sdk.ReportClientDocument;

import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

public class ReportViewerFrame extends JFrame

{

//Initial window frame properties.

private final int XPOS = 75;

private final int YPOS = 50;

private final int WIDTH = 750;

private final int HEIGHT = 600;

//Crystal Report thick-client viewer object that will be embedded into the JFrame.

private ReportViewerBean reportViewer = new ReportViewerBean();

//This report will be viewed in the thick-client viewer.

private com.crystaldecisions.reports.sdk.ReportClientDocument reportClientDoc = new com.crystaldecisions.reports.sdk.ReportClientDocument();

/**

  • Constructs and launches the new frame.

*/

public ReportViewerFrame(/com.crystaldecisions.reports.sdk./ ReportClientDocument reportClientDoc2) throws Exception {

//Initialize frame properties.

this.setResizable(true);

this.setLocation(XPOS, YPOS);

this.setSize(WIDTH, HEIGHT);

this.setTitle("Crystal Report Java Viewer");

//Add GUI components to the frame including the ReportViewerBean.

addComponents();

//Set the report that the ReportViewerBean will display.

this.reportClientDoc = reportClientDoc2;

reportViewer.setReportSource(reportClientDoc2.getReportSource());

reportViewer.init();

reportViewer.start();

//Display the frame.

this.setVisible(true);

}

/**

  • Utility function for adding GUI components to frame. Created to separate

  • the constructor logic of the frame from logic for adding visual

  • components. This function will add the ReportViewerBean to the frame.

*/

private void addComponents() {

//Create new panel and add the ReportViewerBean to it.

Container cp = getContentPane();

cp.setLayout(new BorderLayout());

cp.add(reportViewer);

}

}