• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 750
  • Last Modified:

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
0
Yogeshup
Asked:
Yogeshup
2 Solutions
 
mlmccCommented:
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.

mlmcc
0
 
frodomanCommented:
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!

frodoman
0
 
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.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
mlmccCommented:
Crystal doesn't handle changes like that very easily.

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

mlmcc
0
 
frodomanCommented:
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.

frodoman
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now