Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.NET and setting CrystalReportViewer properties programmatically

Status
Not open for further replies.

N11689

Programmer
Jan 29, 2002
113
US
I am using the .NET assembly for Crystal Report in my VB.NET application. My Crystal Report, however, was not developed in VB.NET. It was developed in Crystal Report XI Release 2 (with Service Pack 2).

I am using the VB.NET (2005) app to execute the report (preview and print).

I have a Windows Form in my VB.NET app that sets the CrystalReportViewer1.ReportSource = ReportDocument. I am using the Form.ShowDialog() in a module to preview the Crystal Report in the Crystal Report Viewer.

However, the Report Viewer is not taking on the properties of the report as it was created. For example: The report was created and saved with the Create Group Tree Report Option unchecked. However, when I preview the report in my VB.NET application, the group tree is appearing in the viewer...it is blank, but it is there. How can I get the viewer to use the group tree property from the report? We will be running various reports through this application. Some do have a group tree, some do not. I need to show the group tree in the preview based on how the report was originally created/saved.

Also, the report seems to be reduced in size in the viewer and not set to Fit-Width as we have saved our reports in Crystal Developer.

So, as you can see, these are a couple but there will be several properties I will need to set in the viewer based on the original report properties.

How do I set these programmatically in VB.NET?
Thank you.
 
crystalreportviewer.showgrouptrrebutton=true ( false )

all the properties beginning by Show.....
 
Yes, I know we can set them to true/false, but how do I set the crystalreportviewer.showgrouptreebutton = objreportdocument's group tree setting?

We have a 'generic' vb.net app that executes our reports. The reports are not embedded in our vb.net app, we load the report using the reportdocument object model load method. How can I get the viewer to take on the reportdocument's properties?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top