on 2020 Feb 04 1:56 PM
Hi,
Before we use Crystal Report 11 and VS20xx and work perfectly when we printer format A4 for make label
Work well inside crystal report 11 and crystal report 13
-------------------------------------------------------------------------------
Us trouble is when is Engine Runtime in C#
When we pass to VS 2019 we need upgrade all and Install VS Crystal Report SP26
I have trouble to success to install Crystal Report SP26 for VS. I finally uninstall VisualStudio and after some reboot.
Crystal and VS2019 work again together.
On this case, we use another printer we print 55mm X 10mm label
Crystal Engine in C# change scale of us QR code and text too.
I change the original version of the report inside VS and mostly do all again inside VS.
I can say is a little better but not look the same inside the crystal. Still have a top margin. I set all margin to zero.
Crystal Engine.dll did not reflect what the viewers print inside VS too.
When I print the old report inside VS with the viewer is perfect.
And if I print my new version modify inside VS now is oversized when I print with the viewer.
Still, look some conflict of version or driver.
I did not understand why inside crystal Report or viewer works fine when we print but not in runtime mode.
is mean crystal not use him DLL Crystal Engine.
How I can solve this issue top marge and scale. I did not want to show to the customer viewer and print after. I want to print directly to the printer.
If we pass to Crystal Report 16 can help or not? But we already CR SP26 for VS
Just look at CrystalReports.ENGINE.dll conflict.... What is the best version to use ? in PROD for distribution and dev ?
Request clarification before answering.
PrintToPrinter uses your default printer properties.No way to change it.
Go into the Viewer Properties ans select PrintOutputController, it uses the Crystal Report Printer properties and dialog.
As I suggested, try my printer test app and POC
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I understand. I make a brand new project VS with brand new report inside VisualStudio 2019
I show you my code.....
what I know Now ....more .... is something with scale and margin property does not look work for me with Engine Runtime. Each time i print with this code. The data of the report is center always and scale smaller and has a top margin. But when I print inside the visual studio with the viewer is works perfect. Good size...left align
now a Reference 13.0.4000.0
I already install before CR SP26 for VS --->File version 13.0.26.3348 ......364KB 11/21/2019 1:18PM
C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.CrystalReports.Engine.dll
i use <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
if somebody can help me solve this issue maybe some code I do wrong. Something I don't know!
Why with the viewer CR VS or Crystal Report 11-13 is perfect print and Now with code is wrong is work well before?
private void printReport() {
ReportDocument crReportDocument; string connetionString = null; OleDbConnection connection; OleDbDataAdapter oledbAdapter;
DataSet ds = new DataSet();
string sql = null;
string strFilename = null;
strFilename = @"D:\DB\xxxxx.mdb";
connetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strFilename + ";";
sql = "Select * FROM label";
connection = new OleDbConnection(connetionString);
crReportDocument = new CrystalReport1();
try {
connection.Open();
oledbAdapter = new OleDbDataAdapter(sql, connection);
oledbAdapter.Fill(ds);
crReportDocument.SetDataSource(ds);
// ************** This is some test for try figure out i never use that before and is not work for me
crReportDocument.PrintOptions.DissociatePageSizeAndPrinterPaperSize = false;
crReportDocument.PrintOptions.PaperSize =CrystalDecisions.Shared.PaperSize.DefaultPaperSize;
crReportDocument.PrintOptions.ApplyPageMargins(new CrystalDecisions.Shared.PageMargins(0, 0, 0, 0));
CrystalDecisions.Shared.PrintLayoutSettings PrintLayout = new CrystalDecisions.Shared.PrintLayoutSettings();
PrintLayout.Centered = false;
PrintLayout.Scaling = PrintLayoutSettings.PrintScaling.DoNotScale;
crReportDocument.PrintOptions.DissociatePageSizeAndPrinterPaperSize = false;
//**********************************
crReportDocument.PrintOptions.PrinterName = "PeriPage A6"; //58mm x 210mm
//crReportDocument.PrintOptions.PrinterName = "Canon MP230 series";
crReportDocument.Refresh();
//Start the printing process. Provide details of the print job //using the arguments. crReportDocument.PrintToPrinter(1, false, 0, 0);
oledbAdapter.Dispose();
connection.Close();
MessageBox.Show("Report finished printing!"); Console.WriteLine(crReportDocument.PrintOptions.PageMargins.topMargin);// =0 when i test
} catch (Exception err){
MessageBox.Show(err.ToString());
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
CR for VS SP 26 is what you need to use.
It's Assembly version is 13.0.4000.0
You can get SP 26 from here:
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
Try the Printer test app on the WIKI page and see if it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
29 | |
9 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.