Print Page | Close Window

Passing data from main report to subreport

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22722
Printed Date: 20 Apr 2024 at 4:12am


Topic: Passing data from main report to subreport
Posted By: barry.ein
Subject: Passing data from main report to subreport
Date Posted: 28 Jan 2019 at 9:19pm
Hi all,

Whenever a user generates a report from the web application a view is created TW_RPT_123_123_123 with one column "id" that contains all the records that the report should display once generated. This view automatically linked to the PR.id table that is part of the report design.

I want to pass the view id values to the subreports but I don't know how to create a parameter for a view that all I know about is that is starts with TW_RPT.

Thanks for your help,

Barry



Replies:
Posted By: kevlray
Date Posted: 29 Jan 2019 at 4:08am
I did not think that views took parameters, just stored procedures.  Not sure of an easy solution here.


Posted By: hilfy
Date Posted: 04 Feb 2019 at 11:39am
Does the view always have the same name or does the name change with each run of the report? If the name changes, does the table get created from the web application or are you running a stored procedure in the main report that creates the table?

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: barry.ein
Date Posted: 04 Feb 2019 at 8:45pm
The view always starts with TW_RPT_ and then there will be 3 sets of numbers based on the user's login account ID then the scope ID and then the Query ID. The scope and query determine which records will be part of the report. the view has one column ID that is automatically linked to the PR.ID.

The view is not part of the report design and it is created only when users are generating reports from the web app.


Posted By: hilfy
Date Posted: 05 Feb 2019 at 7:03am
Is there any way for the website to know what the scope ID and the Query ID are before the report starts running? If not, there is no way to do this.

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: barry.ein
Date Posted: 05 Feb 2019 at 8:50pm
The login ID, Scope ID and Query ID are stored in other tables in the database so they are known before the report is generated from the web app



Print Page | Close Window