cancel
Showing results for 
Search instead for 
Did you mean: 

Upgrading from VS2008 to VS2010 - Report Scaling

Former Member
0 Kudos

I am in the process of upgrading my projects from VS2008 to VS2010.  We have a couple of programs that print on preprinted forms.  Under VS2008 and crystal 10, these reports print properly on the preprinted forms.  Under VS2010 and crystal 13, the fields do not align properly.  They seem to be squeezed from the top to bottom and side to side.

I have searched and cannot seem to find a solution that will give me the crystal 10 functionality.  I have tried the

DissociatePageSizeAndPrinterPaperSize option and that does not restore the functionality.

I have the latest crystal 13 assemblies installed on my development machine.  I also have the latest printer drivers.  The issue appears to be with changes in crystal 13.  If I remove the references to the version 13 assemblies and add the references to version 10, the report prints properly.  (I know this is unsupported, but it does work.)

Has anyone worked through and resolved this issue.

Danny

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Danny,

Open up one of your reports and check this option off and then save it and test:

    

OR in code try setting it:

PrintLayout.Scaling = PrintLayoutSettings.PrintScaling.DoNotScale;

Are you using PrintToPrinter Or PrintOutputController to do the printing?

Try this sample app, rename it to *.zip.

Don

Former Member
0 Kudos

Don,

   Thank you for replying.  I tried the following code with no change in the output.


        Dim PrintLayout As New CrystalDecisions.Shared.PrintLayoutSettings
        PrintLayout.Scaling = CrystalDecisions.Shared.PrintLayoutSettings.PrintScaling.DoNotScale

        Dim printerSettings As New System.Drawing.Printing.PrinterSettings

        printerSettings.PrinterName = dlgPrint.PrinterSettings.PrinterName


        Dim pSettings As New System.Drawing.Printing.PageSettings(printerSettings)


        oRpt.PrintToPrinter(printerSettings, pSettings, False, PrintLayout)

   I am using the PrintToPrinter option.  I don't see a "Center The Page" option on my print dialog.  I also don't see that option in the VS2010 crystal designer.

   The report alignment is down one line from the top and squeezed in from the side.  When I switch back to the 10.x assemblies, the report prints properly.

    I did download your project.  This crystal report is using a dataset to supply the data.  The crystal report is embedded in the project.  I can modify my program to use some of the routines if you think that would be helpful.

Danny

0 Kudos

Report scaling is in the full version of CR Designer.

Did you try setting it in code?

And see if exporting to PDF and then printing the PDF works.

Don

Former Member
0 Kudos

Don,

   I tried the following with no change in the report.

      Dim oLayout As New CrystalDecisions.Shared.PrintLayoutSettings
        oLayout.Centered = False
        oLayout.Scaling = CrystalDecisions.Shared.PrintLayoutSettings.PrintScaling.DoNotScale

        oRpt.PrintOptions.DissociatePageSizeAndPrinterPaperSize = True


        oRpt.PrintToPrinter(dlgPrint.PrinterSettings, dlgPrint.PrinterSettings.DefaultPageSettings, False, oLayout)

If I try to manually set the margins using.

   Dim margins As CrystalDecisions.Shared.PageMargins

        margins = oRpt.PrintOptions.PageMargins

        margins.bottomMargin = 0

        margins.leftMargin = 0

        margins.rightMargin = 0

        margins.topMargin = 0

    oRpt.PrintOptions.ApplyPageMargins(margins)

I can see the report move to the left.  It does nothing for the top margin, which is down one line.

I am open to suggestions, this worked so well in VS 2008 and crystal 10.

Danny

0 Kudos

Hi Danny,

There is very little difference between CR 2008 and CR for VS so it should work. Only thing that could be different is possible the Framework you are using in the new version.

See if ProcessMonitor logs show any difference in registry keys and printer info, could be the printer driver you are using has issue with the updated framework.

Don

Answers (0)