on 09-23-2008 10:11 PM
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!
What version of Crystal Reports are you using?
Ludek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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
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
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
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
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.