| Abraham Andres Luna 2006-01-25, 7:19 pm |
| hey everyone,
i have this code to print a report
i dont want the parameter box to show, is there a way to set the report to
use the default values
here is my code:
ApplicationClass appCrystal = new ApplicationClass();
string strFileName = @"C:\RDK\SFPTSLS10099-BackorderwoPO.rpt";
Report rReport = appCrystal.OpenReport(strFileName,
CROpenReportMethod.crOpenReportByDefault);
DatabaseTableClass dtReport =
(DatabaseTableClass)rReport.Database.Tables[1];
appCrystal.LogOnServer(dtReport.DllName, dtReport.LogOnServerName,
dtReport.LogOnDatabaseName, dtReport.LogOnUserID, "pr0c3d3");
/* I commented this code because i couldn't find the method to just use the
default values
foreach (ParameterFieldDefinitionClass pfdReport in rReport.ParameterFields)
{
//i guess here is where i want to set the field to use the default value
}*/
rReport.EnableParameterPrompting = false; //i thought this would use the
default value and not prompt the user
rReport.SelectPrinter("", "Adobe PDF", "");
rReport.PrintOut(false, 1, false, 1, Type.Missing);
rReport = null;
appCrystal = null;
|