cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Set PageSize Dynamically

Former Member
0 Likes
639

Hi there,

am bit with a problem, can anybody can tell me how to set the pagesize dynamically to a crystal report,


 rpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;
 rpt.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA3;

have written this code but it gives me error as, am i missing anything or some trick is there

Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))Source CrystalDecisions.ReportAppServer.Controllers Target Site Void ModifyPrintOptions(CrystalDecisions.ReportAppServer.ReportDefModel.PrintOptions) Stack Trace at CrystalDecisions.ReportAppServer.Controllers.PrintOutputControllerClass.ModifyPrintOptions(PrintOptions newVal) at CrystalDecisions.CrystalReports.Engine.PrintOptions.set_PaperSize(PaperSize value) at App_UI_CrystalReports_frmSectionWiseResults.btnViewReport_Click(Object sender, EventArgs e) in d:\Projects\SMShetty\App_UI\CrystalReports\frmSectionWiseResults.aspx.cs:line 317

View Entire Topic
Former Member
0 Likes

What version of .NET?

What version of Crystal Reports?

What Service Packs for CR have been applied?

Win or web app?

Can you change the orientation in the CR designer?

What OS?

Is this on the dev computer or after you deploy the app?

Ludek

Former Member
0 Likes

1) Visual Studio Team System 2008

2) Crystal reports 10.5 that comes with VS-2008

3) am having crystal reports basic service pack 1 but its not getting installed

4) Web application

5) Yeah no problems in designer but i need through code behind

6) Windows XP professional with service pack 3

7) on Dev computer

Former Member
0 Likes

3) am having crystal reports basic service pack 1 but its not getting installed

Make sure you have the latest SP for .NET 2008 installed first.

ludek

Former Member
0 Likes

yeah its latest

Former Member
0 Likes

Sorry, but I have to be clear about the details as I can not reproduce the issue here.

You downloaded Microsoft Visual Studio 2008 Service Pack 1 from here;

http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displa...

The you downloaded SP 1 for CR 10.5 from here;

https://smpdl.sap-ag.de/~sapidp/012002523100009351512008E/crbasic2008sp1.exe

And SP 1 for CR 10.5 is not installing(?).

Can you tell me the version of the CR assembly crystaldecisions.crystalreports.engin.dll referenced in your project?

Ludek

Former Member
0 Likes

Microsoft Visual Studio 2008

Version 9.0.30729.1 SP

Microsoft .NET Framework

Version 3.5 SP1

Installed Edition: Enterprise

Microsoft Visual Studio Team System 2008 Development Edition 91904-270-3014571-60906

Microsoft Visual Studio Team System 2008 Development Edition

Microsoft Visual Web Developer 2008 91904-270-3014571-60906

Microsoft Visual Web Developer 2008

Crystal Reports keycode xxx

Crystal Reports Basic for Visual Studio 2008

-


This is the version details which am having currently installed in my system Ludek

Edited by: Ludek Uher on Mar 4, 2010 11:40 AM

Former Member
0 Likes

Can you tell me the version of the CR assembly crystaldecisions.crystalreports.engin.dll referenced in your project?

Go to the properties of your project, find crystaldecisions.crystalreports.engine.dll and tell me the version of this file as referenced in your project. BTW, you do not want to be posting keycodes externally (I'll remove that from the previous post).

Ludek

Former Member
0 Likes

File Version : 10.5.1.2285

Former Member
0 Likes

Strange. No idea why the update does not work. Let's put that aside for now and go back to your code;

rpt.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA3;

What happens if - as a test, you just use ;

rpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;

Ludek

Former Member
0 Likes

I am having the same issue. Nayeem. Were you able to fix this. and change page size using print options.

Regards,

Saurabh