Crystal Reports 2008 conditional sub reports prompt for parmeters twice - crystal-reports-2008

I am using crystal reports 2008 in PeopleSoft with a SQL Server backend. I have a Master report with an underlying query which filters on parameters passed to Crystal Report (EMPLID and Calendar Year these are the underlying tables' Primary Keys).
The master report has sub reports all linked to the the master's EMPLID and Calendar Year fields.
At this point everything works I enter the emplid and year at the prompt and the report runs filtering on those fields.
Each year, the report will change. I set up the subreports so that when I enter 2014 in the prompt, the 2014 version of sub report A will display. If I enter 2015, the 2015 version displays.
When I add these parallel subreports, I get prompted twice. I have checked all of the sub report links. I have made sure that each link selects data in the subreport based on the master field, not the subreport parameter field. I have tried this with conditional subreports and conditional sections and get double prompts. I am stumped. Any ideas of how to use conditional subreports in this way without being prompted more than once?
If this works I intend to add sub report versions for each year. If anyone can think of a better approach feel free to let me know. Thanks.

Firstly...
Have created similar parameters in sub report as main report and linked both sub report and main report parameters using sub report links? If you have not done that then will suggest you to do that so that only once parameters are prompted.
Now.. I don't think your approach is suggested where you are manually adding one sub report for one year, What I would suggest is you to take only one sub report and pass the parameter to the Record Selection formula of the sub report so that I will pick data as per the parameter and your report will also be not complex.
Let me know if you have any different issue.

Related

Could a Matrix mimic this Crystal Report structure - SSRS

I'm trying to convert a Crystal Report to SSRS and I'm having trouble with this section of the report.
The first line of the report event information: date, name, recruiter, hours, etc.
And then under the summary, the report should list changes that are considered critical changes to information about the event. Within Crystal Report, these changes are in the Details section and all changes are listed under each event.
I am trying to accomplish the same task within SSRS but I'm having some trouble with the changes summary. The event summary displays for each record of a change. In the screen shot below, you can see that DriveID 682144 had three changes, but for each change, the event summary is displayed/printed. So instead of Evoqua listed once and the three changes made to the event listed underneath, I am getting the summary displayed for each and every change within the report.
I have a row grouping for DriveID since each event has an unique ID. And I also have a Details row group that displays the changes. I've tried adding a grouping on the Details row group, but if I group on SourceDriveID, it will only display one record for each drive. I am joining the two tables on DriveID (Drivemaster.DriveID=CriticalDriveChanges.SourceDriveID)
I think it would work if the Critical Drive Changes view had a unique identifier, but it doesn't so I am trying to work with what I have. Any suggestions on making this work?
If there is anything I need to explain better, please let me know. I've been stuck on this for two days and need to get through it.
Thanks,
Your second group needs to be grouped by the key of the “changes” and not the DriveID. It’s already grouped by the DriveID because of the parent group. Grouping by the same Field again effectively gives you an extra summary row, its showing the first of the changes.
This can be done by customized summary. You can have a global variable for the summary, and use expression to do the calculation. Some tricks are needed for this kind of report.

Sub Report with a view type datasource returns empty when a parameter is passed

I have a crystal report with few sub reports . i am passing an id to each sub reports as a parameter . So far, three of the four sub reports are fine. But one of them returns empty when ever a parameter is passed. All the sub reports used view type data source
The sub report link between the main report and the sub report that fails is set as below
under the sub report section formulas.
{CONTACTNUMBERVIEW.debtorid} = {?Pm-JobSheetReport.id}
The {CONTACTNUMBERVIEW.debtorid} is a column in the subreport and the {?Pm-JobSheetReport.id} is from the main report. It always returns null. However when i remove the parameter it returns record. I take the id to the view and it shows three records.
I am really confused, where did i go wrong? I did everything i could remember. Please any help would be appreciated.
To the extent I see this {CONTACTNUMBERVIEW.debtorid} = {?Pm-JobSheetReport.id} linking is the problem... where it is returning zero records... try to link the correct field that produces records.
Edit:---------------------------------------------------------------------------------------------
Check the query generated by the sub report and run it against the database to spot the issue that the report is generating.
Since you are able to see the data when adding the field to view perform the same operation on generated query so that you will get the idea on what to make change in crystal with respect to query.
Perform both operations that will solve the issue.

Need multiple copies of the same report in Crystal Report

I am stuck with a peculiar problem. Here is my situation. I have an invoice designed in Crystal Report. I want to provide a feature wherein the user can print multiple copies. The statutory requirement is that every copy will have different title (for e.g. 1st copy may have "Original", 2nd may have "Duplicate for Transporter", etc.) The invoice already has 2 sub-reports (1st for the items and 2nd for tax details). Now I am stuck up as to how do I get multiple copies of the same report with different title. Tried using sub-report but according to crystal report, one cannot use sub-reports within sub-reports.
Request all to please help me some idea. I little new to crystal report. Thanks to all in advance.
My environment is VS 2010, Crystal Report v13, SQL Server 2008, .NET 4.0.
If all data on your reports are the same and only the title is changed, you can set a textObject variable for your title on VB.
Here's how
Dim T As CrystalDecisions.CrystalReports.Engine.TextObject
T = cryRpt.ReportDefinition.Sections(1).ReportObjects("yourTextObjectFromXtalReport")
T.Text = "Your Title"
All you have to do is to set conditions on your program if you want to have multiple reports.
You can also print crystal reports programmatically by following this.
You can create a parameter Title and set the value each time you are printing the report. Drag the parameter to the report in order to have it printed

How Can I compare date of main report with a date of subreport to get data?

I have a main report in of visual studio 2010.
It is group RecipeDate and inside its header there is a subreport.
In subreport there is a IssueDate.
I want to s all the issuance in the subreport issued right after/on RecipeDate but before the RecipeDate.
For Example:
If I have a Recipe prepared on 18/11/2013
and started issuing from the day i.e 19/11/2013
and the next Recipe is prepared on 25/11/2013.
so I want to show all the issuance between 18/11/2013 till 25/11/2013
is it possible?
Link the RecipeDateof main report with the IssueDate of the sub report using main report links and in subreport Record Selection formula add a condition like
?RecipeDate=?IssueDate

Using parameters in reports for VIsual Studio 2008

This is my first attempt to create a Visual Studio 2008 report using parameters. I have created the dataset and the report. If I run it with a hard-coded filter on a column the report runs fine. When I change the filter to '?' I keep getting this error:
No overload for method 'Fill' takes '1' argument
Obviously I am missing some way to connect the parameter on the dataset to a report parameter. I have defined a report parameter using the Report/Report Parameter screen. But how does that report parameter get tied to the dataset table parameter? Is there a special naming convention for the parameter?
I have Googled this a half dozen times and read the msdn documentation but the examples all seem to use a different approach (like creating a SQL query rather then a table based dataset) or entering the parameter name as "=Parameters!name.value" but I can't figure out where to do that. One msdn example suggestted I needed to create some C# code using a SetParameters() method to make the connection. Is that how it is done?
If anyone can recommend a good walk-through I'd appreciate it.
Edit:
After more reading it appears I don't need report parameters at all. I am simply trying to add a parameter to the database query. So I would create a text box on the form, get the user's input, then apply that parameter programmatically to the fill() argument list. The report parameter on the other hand is an ad-hoc value generally entered by a user that you want to appear on the report. But there is no relationship between report parameters and query/dataset parameters. Is that correct?
My last assumption appears to be correct. After 30 years in the industry my bias is to assume a report parameter actually filters the SQL data using the given parameter. This is not the case with .rdlc files used by Report Viewer. These report parameters have nothing to do with fetching data. Sounds like this was a design decision on Microsoft's part to completely separate the display of data from the fetching of data, hence, Report Viewer has no knowledge of how data may be fetched. Best way for me to conceptualize this dichotomy is to think of Report Parameters more as Report Labels, quite distinct from the dataset query parameters.

Resources