Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternatives to Crystal Reports? 1

Status
Not open for further replies.

Amesville

Programmer
Oct 10, 2011
93
0
0
US
Hi Folks

The application I've been working on for a year is nearly finished, but I'm still having trouble with Crystal Reports misbehaving and not performing as I tell it to. I'm using the CrystalReportsViewer control from VB.NET 2008, and I've already narrowed down what I should be doing to force it to print my reports in Landscape Mode. Here's an example of the code I'm using to sent the report to print:

Code:
        'dtWBLoads is a populated Data Table that provides values for the report
        'crvLoads is a CrystalReportViewer object
        'Waybill1 is a Crystal Report 

        Dim LoadsReport As New Waybill1

            'Send Load Page to print
            crvMTYs.Visible = False
            LoadsReport.PrintOptions.PrinterName = objPS.PrinterName
            LoadsReport.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape
            LoadsReport.SetDataSource(dtWBLoads)
            crvLoads.ReportSource = LoadsReport
            crvLoads.Dock = DockStyle.Fill
            crvLoads.BringToFront()
            crvLoads.Visible = True
            crvLoads.PrintReport()

This works fine to print the report, but it is completely inconsistent as to whether the format will be portrait or landscape. The report itself is designed in Landscape mode. However half the time it prints in Portrait anyway. Since these reports are the important part of what my program does this problem is a non-starter.

Please, please help - is there some way I can force Crystal Reports to print these reports properly?

Thanks
 
Oh, and as the subject line reads, if not is there some sort of alternative I can use instead?
 

Instead of using the report viewer to print, print directly from the report document:

LoadsReport.PrintToPrinter(1, False, 0, 0)


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Woo Hoo! That seems to have done the trick! THANK YOU!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top