cancel
Showing results for 
Search instead for 
Did you mean: 

when printing crystal reports, some fields are truncated on the left

Former Member
0 Kudos

When a crystal report is printed programmatically through a .net 2005 application, fields are truncated on the left, but not all the time and not on all the computer workstations. The labels always print correctly, but the data seems to be moved to the left so you can't see the leftmost characters.

Does anybody have any ideas on how to fix this?

I am using crystal reports with framework 2.0 and have the latest (I think) - the dates on the dll's are 6/20/2007.

Any help would be greatly appreciated!

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

What version of Crystal Reports are you using?

Ludek

Former Member
0 Kudos

I am not sure how to find the exact version. It's the version that comes with Visual Studio .net 2005. I am using the 2005 merge modules on client machines.

I did notice that the horizontal aligment on the fields were set to "default" instead of "left". Could that make a difference?

Former Member
0 Kudos

Do you have standalone Crystal Report designer?

Check the version of CrystalDecisions.CrystalReports.Engine and CrystalDecisions.Shared dll.

Try to Export the report do you get the same output?

Regards,

Shweta

former_member183750
Active Contributor
0 Kudos

I did notice that the horizontal aligment on the fields were set to "default" instead of "left". Could that make a difference?

- If the report looks good on your development system, changing the above will not help.

Try the following:

Open the report in design view. Right click on any white space. From the pop-up menu select "Design" -> "Page setup". Enable "No Printer" option. Save and see if that will help.

Ludek

BTW., you are using version 10.2 of Crystal Reports.

Former Member
0 Kudos

okay - I did not have "no printer" checked. Is there a way I can test this before I upgrade a client to see if it works?

former_member183750
Active Contributor
0 Kudos

Yup. Test it on your system by uninstalling the printer driver the report was created with. Then use another printer driver as default. I would recommend actual uninstall of the original printer driver as the report may go looking after the original printer driver even if it is not default. Alternatively, it is always a good idea to have a testing machine and test your apps there before deploying to a customer's system, so do the above there as opposed to your dev system.

Ludek

Former Member
0 Kudos

We have also experienced the same problems.

We found that that printing and design previews were ok and even the dot net viewer could appear correct if you simply altered the scaling up or down from 100% but am still seeking a solution to this myself.

I'll be following your thread closely

Regards

Richard

Former Member
0 Kudos

Great. I'll try it on a machine that doesn't have that printer driver (Microsoft Office Document Image Writer) and see if I can duplicate. Then that should tell me if it's fixed.

Thanks for your help.

Joyce

Former Member
0 Kudos

I implemented the change at a customers site because I still couldn't get it to fail at our office.

They can't tell if this fixed the problem, because now, they can't select what paper tray to print from in the printer. So it is always printing in the tray that has preprinted forms in it. While I told them to switch the paper in each tray, this is not a good solution.

So - if you select 'no printer', does that mean there is no way that they can select what tray to print from?

Any help would be appreciated!

Joyce

former_member183750
Active Contributor
0 Kudos

You should be able to set any printer property supported by the printer driver and Crystal Reports APIs. As your reports are set to "no printer", you will have to specify the printer to be used in code, then select the tray in code. I believe this should work:

myReport.PrintOptons.PrinterName = "my printer name (print a test page to see this)"

then you can use myreport.PrintOptions.CustomPaperSource to set the tray.

For more information on printing, download this file:

https://smpdl.sap-ag.de/~sapidp/012002523100006252822008E/net_win_smpl.exe

The file has several sample apps. Look at vbnet_win_prittoprinter. Checking out the developer help may also help:

https://boc.sdn.sap.com/developer/library

Finally, this White Paper has great info on coding CR with .NET:

http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

If you want to use a printer dialog to set the tray, this may also work:

PrintDialog1.Document = New System.Drawing.Printing.PrintDocument()

PrintDialog1.ShowDialog()

Ludek

Former Member
0 Kudos

OK- I finally got the paper tray resolved. Setting the PrintOptions.CustomPaperSource worked. It did take a little bit to find the paper source from the printDialog. This was the result:

rptReport.PrintOptions.CustomPaperSource = printersettings.DefaultPageSettings.PaperSource

Where rptReport is a variable set to a crystal reports object and printersettings would be a variable set to the value of printersettings returned from the printDialog box.

After all that - setting 'No Printer' in the reports, fixing the paper tray issue, the client is still getting field truncated on the left of the field.

???

So I am trying to reinstall the printer driver on that computer to see if that makes a difference.

Any other suggestions?

Thanks,

Joyce

former_member183750
Active Contributor
0 Kudos

Not sure if I suggested this earlier, but see if the printer manufacturer has an update for the printer driver.

Ludek

Former Member
0 Kudos

I just reinstalled the printer driver and it checked for updates. I should find out in a couple days if that was it.

I really appreciate your feedback in helping resolve this issue.

Joyce

Answers (0)