[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


how do I pass value to linked parameters from to subreports

Posted on 2009-02-19
Medium Priority
Last Modified: 2012-05-06
I am working on a windows application to export the report built in Crystal Report 8.5 to a directory on the server. I am using VB.net 2005 and Crystal Report 8.5.

The report has one main report and one subreport. The subreport has three parameters that linked back to the main report, and the main report itself has two parameters. The main report calls one stored procedure and the subreport calls another stored procedure.  The report runs fine inside Crystal Report designer. However, it returns a blank report when I ran it inside windows application.

I set the parameters values for the main report with following code, and it returns data if I REMOVED THE SUBREPORT

Dim crReportDocument As New ReportDocument
crReportDocument = New ReportName


crReportDocument.SetParameterValue("@Parameter1", ParameterValue1);
crReportDocument.SetParameterValue("@Parameter2", ParameterValue2);

crReportDocument.ExportToDisk(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat, filename)

However, when I added the subreport back and try to set paramter values for the subreports by using the following code,

crReportDocument.SetParameterValue("@SubReport_Parameter1", subReportParameterValue1, "subRepName");
crReportDocument.SetParameterValue("@SubReport_Parameter2", subReportParameterValue2, "subRepName"););

I got "illegal operation on linked parameters" error.

then, I commented out the two lines of code that set parameter values on sub report, but I found none of values is passed from main report to sub report when I run SQL profile trace.  and I didn't get 'Missing Parameter values' error neither.

I searched the internet before posting the question, someone posted links for examples of how passing subreport parameters in .NET, but I wasn't be able to open the links.

Thanks inadvance for your help!

Question by:jrmc-pgmr

Expert Comment

ID: 23687263
Im not sure if its the same as I've only ever used the crystal designer built into visual studio, but I was able to interactively look at the parameters collection on the report document at runtime (via the immediate window)

This helped me sort out a similiar issue.

Accepted Solution

jrmc-pgmr earned 0 total points
ID: 23703414

Thanks for the help! I got it working after converting the report from version 8.5 to Crystal 11. It turns out Crystal 8.5 is not compatible with VS 2005. Also, I don't need to assign value to the linked parameters in subreport.

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month19 days, 13 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question