Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am facing some alignment problem for the past few days.

Initially I designed my report in Crystal X1 R2(which supports COM API) to print the report in the pre-designed template. Later I upgraded my application to latest crystal Runtime(which supports .NET). After that I am facing some alignment problem when print the report.

After up-gradation, i could see some lines are pushed down and few lines are pushed up and it is not printing properly in the pre-designed template.

I tried to do changes in the designer but it is not printing properly.

I have designed report with zero Page Margins and Paper size is A4.

I can see the correct alignment when printing it directly from Crystal designer But When i print the report pro-grammatically through crystal run-time i am facing the same alignment problem.

When analysing this, I noticed few things.

* Only I am facing the problem with zero margin

* After run time-upgradation, When previewing the report I found additional option in the Print dialog of latest crystal viewer. It is page scaling option and It is defaulted with "Scale report page to fit printer page" and disabled.

* We can export the report to various formats. In that case it is working fine for pdf or woreport document when the page scaling option is set as "Do not scale".

Please find the peace of sample code to print the report (Using sample C# application)

private void Print(object sender, EventArgs e)
{

ISCDReportClientDocument rptClientDoc;
PrintOutputController printout;
PrintReportOptions rasprint = new PrintReportOptions();
CrystalDecisions.Shared.PrintLayoutSettings PrintLayout = new CrystalDecisions.Shared.PrintLayoutSettings();
CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

report.Load(@"C:\Users\Desktop\Sampleprintout\sample.rpt"); //design simple report with various page margins

rptClientDoc = report.ReportClientDocument;
printout = rptClientDoc.PrintOutputController;
rasprint.PrinterName = "HP LaserJet 2200 Series PS";
printout.PrintReport(rasprint);


}

Note: Need to add necessary reference files from "C:\Windows\assembly".

I am still struggling to fix this one.

Please help me out.

Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900