Landscape

lunedì 27 aprile 2009 - 16.29

lanfra Profilo | Senior Member


Salve, non riesco ad impostare il mio report in formato Landscape sulla stampante.
Mi spiego, quando eseguo la stampa il formato di default, prende il soppravvento su quello che imposto io da codice...

'LANDSCAPE rpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape RPT_EXTRA_REPORT.ReportSource = rpt

come dice Matteo su un altro forum...

Dove sbaglio??????

Grazie per eventuali aiuti a riguardo.

Riporto la risposta della Buisness Object, che risolve il problema conosciuto della stampa in landscape.

[i]
A report in a Crystal Reports for Visual Studio .NET 2005 web application using the ActiveX print control is set to print with landscape orientation. However, when it is printed, the output is in portrait orientation. This can result in data to be deleted from the right side of the report.


Cause

This behavior is due to the paperorientation property incorrectly referenced as pageorientation in the Crystalprinthost.html file on the web server.


Resolution

To resolve this issue, edit the Crystalprinthost.html file in the following locations:

* <installation directory>:\Inetpub\wwwroot\aspnet_client\2_0_50727\CrystalReportWebFormViewer3\crystalprinthost.html
* <installation directory>:\Windows\Microsoft.NET\v2.0.50727\ASP.NETClientFiles\CrystalReportWebFormViewer3\crystalprinthost.html

Edit the incorrect block of code below to match the correct block.

Incorrect

if (window.dialogArguments.pageorientation) { objectTag +="<PARAM NAME=\"PageOrientation\" VALUE=\""; objectTag += window.dialogArguments.pageorientation; objectTag += "\">"; }

[b]Correct[/b]

if (window.dialogArguments.paperorientation) { objectTag +="<PARAM NAME=\"PageOrientation\" VALUE=\""; objectTag += window.dialogArguments.paperorientation; objectTag += "\">"; }

The report will now print properly in landscape orientation.

TIP


If the code sample is truncated in your browser window, copy and paste the entire block of code into a text editor. Code samples are intentionally formatted this way so they do not wrap. Wrapped code can produce unexpected errors in your application.

NOTE


The PageOrientation in the PARAM tag is not a typo. This value is used by the ActiveX control and can't be changed at this time.


Keywords

DOTNET NET .NET PORTRAIT LANDSCAPE PRINT PRINTING ACTIVEX WEB 2005 PRINTCONTROL , 2716447

[/i]

saluti

freeteo Profilo | Guru

Ciao lanfra,
grazie per aver postato la soluzione, ottima cosa dato che può tornare utile a qualcun'altro che magari sta cercando soluzione allo sesso problema...

Ciao.

Matteo Raumer
[MVP Visual C#]
http://blogs.dotnethell.it/freeteo
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5