on 2025 Mar 24 12:09 PM
Hi,
A customer of us has problems printing Labels in the Orientation he wants.
He uses a helper Program to read out the Report Orientation to use as Printer Setting. The Report has the Orientation set to Landscape, but the read out Value is Portrait.
Report Page Setting:
The C# Source used to read the Value is:
report = new ReportDocument();
report.Load(reportPath);
var reportOrientation = report.PrintOptions.PaperOrientation;
// Alternate way to get the orientation
var reportCOrientation = report.ReportClientDocument.ReportDocument.PrintOptions.PaperOrientation;
Both ways return Portrait instead of Landscape. Does anyone know of another way to read the real Page Setting set in the Report for the Orientation?
Request clarification before answering.
That is odd, It works using this:
// this info is saved in the RPT file
if (rptPRT.PaperOrientation.ToString() != "crPaperOrientationPortrait")
{
PROrientation.Text = "LandScape";
}
else
{
PROrientation.Text = "Portrait";
}
Seems it should work your way.
Looking at your Page Setup you have No Printer checked on, CR still gets the paper orientation though.
What is your default Printer?
Some MS product don't support landscape....
When Printing Labels you should always set the Printer to a real printer when designing the report.
See my Blog on using Label Printers:
And see if my Printer Test app works for you:
Printing Crystal Reports in .NET
In short create a custom paper size and use a Common name for it, then create the custom paper size on every printer. CR saves that name in the RPT file and it will look for the Name and then the ENUM for the custom paper size. Don't sue No Printer, that uses the screen driver to format the page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
12 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.