Report Orientation in Jasperreport - jasper-reports

I have a report this is the details as follow:
- the paper size is A5
- the orientation based on the xml file is Landscape but when printing, the output is portrait.
Then when I download the file (I used adobe reader) when I go to print preview I selecting the Landscape, the report is not change to landscape format. I am new in this scenarios Please Help me out
thanks.

It is not sufficient to change pageHeight and pageWidth.
Additionally you have to set orientation="Landscape" in the top-level jasperReport tag. Otherwise it could be that some tools will always re-set your report back to portrait and ignore the width and height settings.
This option is also available in Jaspersoft Studio:

Related

Jasper HTML output width issue

This report is generated with jasper reporting tool with REST API. Report data is showing in an HTML page with an iframe. After loading data to the iframe, report HTML view showing a lot of white spaces in the right and left side. I have tried with increasing the iframe width in CSS. But this is not affecting the report. Is it possible to adjust white spaces from jasper report itself? I am using page size as A4 landscape.
I have attached the image:
Hi,
I have attached the image once again, You can see the Blank spaces on left and right side. How to remove this?. i have attached the jrxml link also. please help.
https://files.fm/u/56nnrd9z
Hi,
I have attached the Jrxml code link once again, please check it.
https://drive.google.com/file/d/1P9aeNW7YTIndNDyv8jkCwO_RQGf32iZu/view?usp=sharing
Various settings affect the output width of HTML reports, including:
Size unit (POINT vs PIXEL)
Zoom ratio
Page margins
For example:
final SimpleHtmlReportConfiguration configuration = new SimpleHtmlReportConfiguration();
configuration.setIgnorePageMargins(true);
configuration.setSizeUnit(POINT);
// Or try this instead of setSizeUnit(POINT)...
//configuration.setZoomRatio(2.0f);
final HtmlExporter exporter = new HtmlExporter();
exporter.setConfiguration(configuration);
If there are images in the report, consider using SVG format to avoid pixelation.
Additional information about these settings is at:
https://community.jaspersoft.com/jasperreports-library/issues/4483
https://community.jaspersoft.com/jasperreports-server/issues/6577
From the JasperSoft community site, you can set the zoom ratio in a JRXML file, described as follows:
You should be able to set a default zoom value by setting this property at report level:
<property name="net.sf.jasperreports.viewer.zoom" value="FitWidth" />
Other possible values:
ActualSize
FitHeight
FitPage
integers (e.g., 2 for 200%)
decimals (e.g., 0.5 for 50%)

IReports does not print length more than 297mm

I using ireport 4.0.1. I made a receipt print which is more than 297mm but it cuts at exactly at 297mm all the time. Rest of the data are not getting printed. But when i save it as a pdf i could see all the data. I tried with different kinds of printers (Eg: Epson TM20 -Receipt printer) but no positive changes :( I am using "ignored pagination" in my jrxml file. Could someone help me solving it ?
Set your design properties to more then your desired size.
Set your margins to be smaller.
Experiment with the orientation.
As for your printer itself- it should have the exact same settings and property aspects as these.
Note that it is most definetly a setup and size issue and more then likely NOT your printers.
Here is an image of the properties menu in iReport and to open it go to WINDOW on the top bar and click PALETTE.
Your report need to have a report footer and the height is equal to the A4 size.
It fixed my 2 years problem with receipt printing

Mix Portrait and Landscape in Crystal Report

I am preparing a report and currently I have a portrait and landscape subreports, I want to mix them in one report.?
It's possible to combine landscape and portrait subreports, you need a new section for ever subreport.
Right click on one of the section and select "Section expert", from here you can add new sections by clicking on an existing section (header, details, footer) and the Add button on the "Paging" tab on the right you can decide the orientation of you section (Default (portrait), landscape and portrait).
Now create your subreport and put it in the new section.
For a portrait subreport just follow the default creation procedure.
For a landscape subreport create a landscape oriented section and in the subreport set landscape orientation in each section of the subreport.
Page Header and Page Footer won't allow you to change the orientation, so in your landscape subreport suppress those section without drill down (right click on the section to find this option) or Crystal Report will act weird and create a new page for every section with different orientation and suppressing them will prevent this situation.
At the end you will have a situation like this
If a main report is set to portrait orientation and the subreport is set to landscape, the subreport will print landscape, on a portrait oriented page, thus resulting in data being cut off. In the reverse scenario, main report is landscape, subreport portrait, the subreport will print portrait on a landscape oriented paper and as above, data will be cut off.
I am using Crystal Reports 10. It doesn't has "Paging" tab in Section Expert. I believe mix page orientation is not possible in this version.

Crystal report 2008 User Defined Page Layout

I want to set the Report Layout on client side So User can set report's layout Which may be Portrait OR Landscape after report shown. So user will have the option if data comes on half page then he can use landscape to print Report Otherwise Portrait.
If you're wanting to design two different report layouts in one RPT file and pick one at runtime, that's not really possible. If you're just wanting to know how to set the orientation, here are the properties for doing that:
cryRpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape
cryRpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Portrait
cryRpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.DefaultPaperOrientation

Horizontal page in Crystal Reports

How can I design my report to use it horizontally ? I really need more fields so vertically won't show everything.
Thanks.
edited:
I need the page to be landscape instead of portrait.
Sorry, my version is 8.0.
You should be able to change the orientation under the printer settings for Crystal from File > Print...
As long as your printer supports landscape printing, the report will reflect the change (check printer drivers if it doesn't allow landscape but you think it should).
Depends on if you are trying to do this at design time or run-time, and it depends on the version of Crystal Reports you are using. Usually you go to File -> Page Setup to change the paper orientation and size.
Edit - the runtime environment for that version of Crystal doesn't support changing the paper orientation at program execution through the CrystalReport object, just when you are designing the report. You would have to change the orientation using the printer options when selecting the printer to print to.
If you right click on your report,go to design-> page setup, there will be an orientation tab to select landscape or portrait.