ecathell
asked on
PrinttoPrinter Method of Strongly typed report does not print data
crLoadConfirmation = New LoadConfirmation
count = crLoadConfirmation.Databas e.Tables.C ount()
Debug.WriteLine("LoadConfi rmationCou nt= " & count)
'========================= ========== ========== =
'crLoadConfirmation = changeLCReportLocation(crL oadConfirm ation)
'========================= ========== ===
crParameterDiscreteValue = New ParameterDiscreteValue
crParameterDiscreteValue.V alue = load
crParameterField = New ParameterField
crParameterField.Parameter FieldName = "LoadNo"
crParameterField.CurrentVa lues.Add(c rParameter DiscreteVa lue)
crParameterFields = New ParameterFields
crParameterFields.Add(crPa rameterFie ld)
Me.CrystalReportViewer1.Pa rameterFie ldInfo = crParameterFields
Me.CrystalReportViewer1.Re portSource = crLoadConfirmation
crLoadConfirmation.PrintTo Printer(1, False, 1, 1)
That is a sample of my code. If i use the same code and open the report in the Report Viewer my data is present. Printing it this way The structure of the report is there, but no data is present.
here is a code sample of wher I use the Report Viewer for the same report:
''CR Variables
crLoadConfirmation = New LoadConfirmation
count = crLoadConfirmation.Databas e.Tables.C ount()
Debug.WriteLine("LoadConfi rmationCou nt= " & count)
'========================= ========== ========== =
'crLoadConfirmation = changeLCReportLocation(crL oadConfirm ation)
'========================= ========== ===
crParameterDiscreteValue = New ParameterDiscreteValue
crParameterDiscreteValue.V alue = load
crParameterField = New ParameterField
crParameterField.Parameter FieldName = "LoadNo"
crParameterField.CurrentVa lues.Add(c rParameter DiscreteVa lue)
crParameterFields = New ParameterFields
crParameterFields.Add(crPa rameterFie ld)
Me.CrystalReportViewer1.Pa rameterFie ldInfo = crParameterFields
Me.CrystalReportViewer1.Re portSource = crLoadConfirmation
count = crLoadConfirmation.Databas
Debug.WriteLine("LoadConfi
'=========================
'crLoadConfirmation = changeLCReportLocation(crL
'=========================
crParameterDiscreteValue = New ParameterDiscreteValue
crParameterDiscreteValue.V
crParameterField = New ParameterField
crParameterField.Parameter
crParameterField.CurrentVa
crParameterFields = New ParameterFields
crParameterFields.Add(crPa
Me.CrystalReportViewer1.Pa
Me.CrystalReportViewer1.Re
crLoadConfirmation.PrintTo
That is a sample of my code. If i use the same code and open the report in the Report Viewer my data is present. Printing it this way The structure of the report is there, but no data is present.
here is a code sample of wher I use the Report Viewer for the same report:
''CR Variables
crLoadConfirmation = New LoadConfirmation
count = crLoadConfirmation.Databas
Debug.WriteLine("LoadConfi
'=========================
'crLoadConfirmation = changeLCReportLocation(crL
'=========================
crParameterDiscreteValue = New ParameterDiscreteValue
crParameterDiscreteValue.V
crParameterField = New ParameterField
crParameterField.Parameter
crParameterField.CurrentVa
crParameterFields = New ParameterFields
crParameterFields.Add(crPa
Me.CrystalReportViewer1.Pa
Me.CrystalReportViewer1.Re
crLoadConfirmation.PrintTo Printer(1, False, 1, 1)
why are yuo printing the only 1st page
if you want to print every page you should use
crLoadConfirmation.PrintTo Printer(1, False, 0, 0)
and for the sake of it i will run this code before you set the viewer's datasource
Regards
Emre
why are yuo printing the only 1st page
if you want to print every page you should use
crLoadConfirmation.PrintTo
and for the sake of it i will run this code before you set the viewer's datasource
Regards
Emre
ASKER
crLoadConfirmation.SetPara meterValue ("LoadNo", crParameterDiscreteValue.V alue)
crLoadConfirmation.PrintTo Printer(1, False, 1, 1)
actually I am printing only one page because there is just one page.
This is the answer to my problem, i discovered it on my own. Because the report is no longer actually using the viewer I have to pass the parameter value to the report and not the viewer control.
Eric
crLoadConfirmation.PrintTo
actually I am printing only one page because there is just one page.
This is the answer to my problem, i discovered it on my own. Because the report is no longer actually using the viewer I have to pass the parameter value to the report and not the viewer control.
Eric
Sounds good
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try
crLoadConfirmation.PrintOu
mlmcc