Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

"Database logon failed" error while trying printing a document

$
0
0

Hi, recently I went from CR Basic for VS2008, to CR 13.0.2 (for VS 2010) on Windows 7 (64 bit) and Iam using .NET 4.5 framework.

In VS2008 all was working fine, now I get the "Database logon failed" error, and I DO NOT use any database! I only fill Parameter and Formula fields on the Crystal Report, and try to print it out. As mentioned, in VS 2008 all was woking OK, now its not. Why so??

 

Here is my simple code:

//passing data to parameters like (one example):

cr1.SetParameterValue("ParameterName", Actual_Parameter);

 

//and my code for prinitng:

PrintDocument doctoprint = new PrintDocument();

doctoprint.PrinterSettings.PrinterName = objPrinter.Value.ToString();

cr1.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.DefaultPaperSize;

CrystalDecisions.Shared.PageMargins margins = new CrystalDecisions.Shared.PageMargins(0, 0, 0, 0);

cr1.PrintOptions.ApplyPageMargins(margins);

crystalReportViewer1.ReportSource = cr1;

cr1.PrintToPrinter(1, false, 0, 0);  //and here i get the error!

 

Can someone help me out? I really have no idea what to do.

Mitja


Viewing all articles
Browse latest Browse all 3636

Trending Articles