?
Solved

PrinttoPrinter Method of Strongly typed report does not print data

Posted on 2004-09-17
6
Medium Priority
?
255 Views
Last Modified: 2008-02-20
crLoadConfirmation = New LoadConfirmation

                    count = crLoadConfirmation.Database.Tables.Count()
                    Debug.WriteLine("LoadConfirmationCount= " & count)
                    '==============================================
                    'crLoadConfirmation = changeLCReportLocation(crLoadConfirmation)
                    '======================================

                    crParameterDiscreteValue = New ParameterDiscreteValue
                    crParameterDiscreteValue.Value = load

                    crParameterField = New ParameterField
                    crParameterField.ParameterFieldName = "LoadNo"
                    crParameterField.CurrentValues.Add(crParameterDiscreteValue)

                    crParameterFields = New ParameterFields
                    crParameterFields.Add(crParameterField)
                    Me.CrystalReportViewer1.ParameterFieldInfo = crParameterFields
                    Me.CrystalReportViewer1.ReportSource = crLoadConfirmation
                   
                    crLoadConfirmation.PrintToPrinter(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.Database.Tables.Count()
                    Debug.WriteLine("LoadConfirmationCount= " & count)
                    '==============================================
                    'crLoadConfirmation = changeLCReportLocation(crLoadConfirmation)
                    '======================================

                    crParameterDiscreteValue = New ParameterDiscreteValue
                    crParameterDiscreteValue.Value = load

                    crParameterField = New ParameterField
                    crParameterField.ParameterFieldName = "LoadNo"
                    crParameterField.CurrentValues.Add(crParameterDiscreteValue)

                    crParameterFields = New ParameterFields
                    crParameterFields.Add(crParameterField)
                    Me.CrystalReportViewer1.ParameterFieldInfo = crParameterFields
                    Me.CrystalReportViewer1.ReportSource = crLoadConfirmation
0
Comment
Question by:ecathell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 12084154
The report views ok?  Can you print it from the viewer?

Try
crLoadConfirmation.PrintOut False

mlmcc
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12084225
 crLoadConfirmation.PrintToPrinter(1, False, 1, 1)

why are yuo printing the only 1st page

if you want to print every page you should use
  crLoadConfirmation.PrintToPrinter(1, False, 0, 0)
and for the sake of it i will run this code before you set the viewer's datasource

Regards
Emre

0
 

Author Comment

by:ecathell
ID: 12084975
crLoadConfirmation.SetParameterValue("LoadNo", crParameterDiscreteValue.Value)
                    crLoadConfirmation.PrintToPrinter(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
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12302428
Sounds good
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12327403
PAQed, with points refunded (250)

Computer101
E-E Admin
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question