For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > January 2006 > howto use default values when printing reports









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author howto use default values when printing reports
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;


Abraham Andres Luna

2006-01-25, 7:19 pm

nevermind figured it out


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com