I want to Set Custome PaperSize of Printer into CrystalReportViewer>Print Report>Preferences>Advance>Paper Size.
Loading
I want to Set Custome PaperSize of Printer into CrystalReportViewer>Print Report>Preferences>Advance>Paper Size.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh KumarPosted Dec 15, 2024, 10:02 AM
Hello,
You can use below code to achive custom size,
Gross AccountPosted Dec 12, 2024, 1:21 PM
Thank For Answering
But Your Given Solution Not Working Properly.
reportDocument.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)customPaperSize;
This one give error like "Cannot Convert type'System.Drawing.Printing.PaperSize''to "CrystalDecisions.Shared.PaperSize""
=>The error you are encountering occurs because
CrystalDecisions.Shared.PaperSize.PaperCustomis not a valid predefined value inCrystalDecisions.Shared.PaperSize. Unfortunately,CrystalDecisions.Shared.PaperSizedoes not have direct support for custom paper sizes.Jayraj ChhayaPosted Dec 12, 2024, 9:55 AM
Hi Gross Account,
To set a custom paper size for a printer in CrystalReportViewer, you can utilize the
PrinterSettingsclass in C#. Below is a step-by-step approach to achieve this:Create a Custom Paper Size: First, define your custom paper size using the
PaperSizeclass.Assign the Custom Paper Size to the PrinterSettings: Use the
PrinterSettingsobject to set the custom paper size.Set the PrinterSettings in the ReportDocument: Finally, apply the settings to your Crystal Report.
This code snippet will set the custom paper size for the printer when printing from the CrystalReportViewer. Ensure that the printer supports the specified paper size to avoid any printing issues.