Dynamic Property changes in Crystal Report Using ASP.net

Ihave a problem in crystal report .i hv 5 to 6 subreports in Main report.and i adjust their height and width.and some time one of the subreport do not show any result and due to that reason their is gap between subreports.i try to access the crystal report objects programmicaticlly and i succeed in accessing the normal objects like Text Box through this line of code. crp.ReportDefinition.Sections("ReportHeaderSection1").ReportObjects.Item("Text2").Left = 8000 This line work and i m able to change its left ,width and etc. but when i access the cross tab or subreport through the same line of code crp.ReportDefinition.Sections("ReportHeaderSection1").ReportObjects.Item("Crosstab").Left = 8000 i get arror message Add or chnage this type of Report Object is not allowed. Kindly help me in that Regard.I am waiting
Who is Participating?
Crystal doesn't handle changes like that very easily.

A better idea might be to have 2 reports.  Identical except for orientation.

You can suppress blank subreports or blank sections to avoid the blank areas.

Try using CrossTab1

You can use the Report explorer to find the names of the report objects.

Agree - use the built in Crystal functionality to suppress if blank rather than mucking around with properties externally while the report is rendering.  You will get much better results that way!

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

YogeshupAuthor Commented:
seems like i have not put up the question properly.  Very sorry about that.

I have a main report which consists of several sub-reports in different sections.  I have designed the sub-reports and the main report in portrait (paper orientation).  My requirement is that based on the user selection (ie. Portrait / Landscape), the report should be generated in the respective orientation.  I am able to change the position or size of the textobject placed in the main report by using the code

crDocument..ReportDefinition.ReportObjects.Item("TemplateName2").Left = 12000
crDodcument.Width = 15000

Also, the report is getting generated properly in the screen based on the paper orientation selected by the user.  

The problem is that when I export the report in PDF, the sub-report part (which includes cross-tab) gets printed as per portrait (ie. gets cut).  Looks like cross-tab exports based on portrait orientation.  

Hope the question is clear now.   Would really appreciate help on this one.

Thanks is advance.
I saw one discussion of a very similar sounding problem that was fixed by a service pack - I believe it was on XIr2.  If you haven't already done so, you should apply any outstanding service packs to see if that helps.

I agree with mlmcc though - if a service pack doesn't fix it, it's unlikely to be workable and you may need to take the alternate approach of two different reports.

Forced accept.

EE Admin
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.