Torna al Thread
System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();
pd.PrinterSettings.PrinterName = MyReport.PrinterName;
foreach (System.Drawing.Printing.PaperSource ps in pd.PrinterSettings.PaperSources)
{
//Trim data from Driver, and take the first one that Starts with our PaperSource name (ie: 'Auto' matches 'Automatically Select' and 'Auto Select' ')
if (ps.SourceName.Trim().StartsWith(MyReport.PaperSource))
{
MyCrystalReport.ReportDoc.PrintOptions.CustomPaperSource = new System.Drawing.Printing.PaperSource();
MyCrystalReport.ReportDoc.PrintOptions.CustomPaperSource.RawKind = ps.RawKind;
break;
}
}
//If nothing matches MyReport.PaperSource it will use the papersource in the crystal RPT file instead of MyReport.PaperSource.