cancel
Showing results for 
Search instead for 
Did you mean: 

CRVS2010 Beta - Printing incorrectly using VSCR2010

Former Member
0 Kudos

I have just started using Crystal Reports (beta 2) in Visual Studio 2010, and am having a few problems with the CrystalReportViewer, running in Windows 7 64-bit, and the printer Samsung SCX4500.

I have created a report which works fine in both the designer and live using CrystalReportViewer in WPF, which is great. When printing from the designer, it prints exactly as I would expect it to. However when printing from the CrystalReportsViewer, I have a few different problems.

1) Although the report has the correct font sizes when shown in the viewer, when exporting to a PDF, the font size is much smaller, but there's still the same amount of entries per page.

2) When attempting to print (either to an actual printer or to an XPS file), the font size is the same as if it was exported to PDF, but only prints in a quarter of the page, and cuts off some of the data. Maybe a little hard to explain but I can provide a scan or something if needed.

Because the same behaviour is exhibited when printing to XPS and printing to a physical printer, I don't think the problem lies with printer drivers, which would have been the next thing for me to investigate. Everything else prints fine both to the printer and to XPS.

Hopefully this is a known problem and has a simple solution. I haven't tried running the WinForms version of the viewer yet as I'd like to keep everything in WPF.

Subject modified as per the sticky post at the top of this forum; [Crystal Reports for Visual Studio 2010 Beta - read before posting|;

Edited by: Ludek Uher on Aug 27, 2010 8:40 AM

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Re. the font export issue. See if you can guide your self by the KBase [1207181 - Font size is reduced when exporting to PDF in Crystal Reports for Visual Studio .NET 2005|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7b6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303337333133383331%7d.do]

I'm just starting up a CRVS2010 image so I don't have the exact reg. keys in front of me.

Re. Printing issue. I'll test it once the image is running and get back.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

former_member183750
Active Contributor
0 Kudos

I just did a test on the printing and export. Both work fine for me. Export has no degradation of font. Printing was perfect. This is on a report that is 8 1/2 X 11 paper size, portrait.

I'm attaching the saved data report I used. It would be great if you can test with that.

Let me know if it is possible to get your report with saved data.

Ludek

Former Member
0 Kudos

Hi,

Thanks for the link to the PDF font size KB. The Pdf key didn't exist in my registry but I added it and PDF export works great now. Many thanks for that.

As for the other issue, I've done some further playing around and it only happens if the report is a landscape report, and this seems to be a common issue with XPS (and I can only assume that the Samsung Universal Print Driver has something in common with that). For example, here's one of many XPS landscape posts I've found online with no easy answer - http://forums.asp.net/p/1411297/3498949.aspx

I didn't see an attachment in your post but I'm probably just being daft. For now, though, I can restructure some of the reports in portrait, and those that need landscape can just be exported to PDF and printed if needed. The company I'm doing the work for are trying to move away from printing so much so this is probably something that would help them with that.

former_member183750
Active Contributor
0 Kudos

This may actually be a good tip for me. E.g.; do a quick landscape print here. I'll let you know how that goes.

Ludek

Former Member
0 Kudos

Hi guys,

I dont mean to "hijack" the thread but I am having the same problem.

I am using Windows 7 Ultimate 64-bit, Visual Studio Ultimate and my printer is a HP laserjet P3005n.

Just like sidasta, my report is in landscape mode. When I view it in the report preview section of the report designer, or view the report in the WPF report viewer, it is displayed fine. Also, when I export to PDF the report looks fine.

It's only when I go to print the report that it goes wrong. I have also tried printing to the XPS printer as well as my physical printer and have the same result both times - the report appears on a portrait page instead of a landscape one. The report itself appears halfway down the page, and only the left hand 50% or so of the report is displayed.

Things I have tried so far to correc the problem:

- Checking in the report designer, under page setup. Tried checking "No printer (optimize for screen display)", tried checking "dissociate formatting page size", and changed the paper size to A4 and orientation to landscape.

- I've also tried setting the page size and orientation in code, like so:

Reports.AirSchedules.AvailabilityScheduleReport ASR = new Reports.AirSchedules.AvailabilityScheduleReport();
            ASR.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA4;
            ASR.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;
            ASR.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;

I'm out of ideas now 😐

former_member183750
Active Contributor
0 Kudos

I tested this with a WIN app and a WPF app and was not able to reproduce the issue.

Here is what I did, let me know what differences you see:

1) Add a report to the project. Tested with both strongly typed reports and reports loaded from path.

2) Go to the CR pop-up menu and select Design -> Page setup. Enable the Landscape option.

3) View report in the viewers (win and wpf)

4) Hit the print button

5) Get a landscape report

My testing was with A4 paper and 8.5 X 11. Only thing I did notice with WPF; there is no print progress dialog as there is with a win viewer so I'll check into that.

Ludek

Former Member
0 Kudos

Hi Ludek,

Because my original problem occurred when adding a report to an existing WPF report, I decided to start a new project from scratch - so here's what I did.

1) In VS2010, create a newCrystal Reports WPF application.

2) Add a "strongly typed" report. This report contains a single text object

3) As you instructed, right click->Design->Page setup and enable landscape

4) Populate the reportviewer with the following code:

CrystalReport1 CR = new CrystalReport1();
            this.reportViewer.ViewerCore.ReportSource = CR;

5) Display report in WPF viewer. Report displays in landcape mode as expected.

6) Print report - when report prints, the report print on a portrait piece of paper - the report if halfway down the page.

I thought the problem may have been because I was adding to an existing project, but I've listed everything I've done above and still the same problem.

Any more ideas? Or any more information I can provide for you to track the error down?

Thanks

Chris

Former Member
0 Kudos

Here are links to a couple of images I've uploaded of what I'm seeing.

This image shows the report as it appears in the WPF viewer:

http://img138.imageshack.us/i/reportiz.jpg/

This image shows the report once I've printed it to the XPS printer:

http://img13.imageshack.us/i/printir.jpg/

I've also tried to print to two different physical printers - the report prints exactly the same as in the XPS document.

former_member183750
Active Contributor
0 Kudos

Let me know if you can share that report with me. I'll setup an ftp container for you where you can download it. Doing the same steps, I can not reproduce the issue at all.

Ludek

Former Member
0 Kudos

Hi Ludek,

That would be fine - I can send you the aforementioned test solution with a very basic report. The one I have attached screenshots of will not really work because it is dependent on some data from one of our internal web services.

If you set me up an ftp share, I'll deposit a test solution (VS2010) complete with a test report on which I'm getting the same issue.

I suspect it may actually be something to do with my print drivers. I think the xps printer may use my default print driver, which would explain why I get the problem on both a physical print and an xps print.

Chris

former_member183750
Active Contributor
0 Kudos

I'll set up an ftp container. You should be getting an email from the server with instructions in about 1/2 an hour.

Ludek

Former Member
0 Kudos

Hi Ludek,

I still haven't received an email with FTP instructions.

Chris

former_member183750
Active Contributor
0 Kudos

Ok. I've recreated the container. Make sure you use the same email as the one that you registered on this forum.

Ludek

Former Member
0 Kudos

Ok Ludek,

I have uploaded the test solution. It literally just contains a test report which doesn't even take any data as an argument. The issue only occurs when I print.

Let me know if you need any more information.

Chris

former_member183750
Active Contributor
0 Kudos

Duplicated and submitted to Program Management for resolution.

- Ludek

Answers (3)

Answers (3)

0 Kudos

Final Production release is now available. See this thread for more info:

Former Member
0 Kudos

Yes, I did figure out that exporting the report to pdf and then printing it does work. I do need a solution though because most of our clients do a direct print from the viewer.

We are on Windows XP using Crystal Reports Beta 2 for Visual Studio 2010. I have tried printing to different printers and have had the same result so looks like this is not a printer issue.

Hopefully Ludek can help. Thanks for your response! At least I know I am not the only one

Former Member
0 Kudos

Has anyone found a solution to this issue? I am having the exact same problem printing a report in landscape view. I am using CRVS2010 Beta 2.

All my reports print perfectly in portrait. When I try to print a landscape report out, it moves all the data to the middle of the page, makes the font very small and cuts off some of the data on the right. I have tried several things and nothing seems to work.

Any solutions? ideas?

Former Member
0 Kudos

I haven't found a proper solution to this yet - perhaps Ludek can update on the status of this bug?

I have found a bit of a workaround though - if you export the report to PDF and then print it, it seems to print ok. It's just the print operation within the WPFViewer that appears to be the problem.

Other developers in my office have the same problem so it does not appear to be specific to my PC, although we are all on Windows 7 64-bit and using Visual Studio 2010.