Linking fields to subreport - crystal-reports

In my main report I have some fields which I need to use in my subreport.
Right now I'm loading one csv file in both the main and the sub reports, but this seems to slow down the preview of my reports (I need these reports in a program). Eve if I use the preview in Crystal Reporst, it loads 3 times the same database, so I was thinking about linking the fields.
So I do Right Click on Subreport -> Change Subreport Links... and then I put the fields I want on the right side of the shown table. But when I do a preview of the whole report, in the subreport it shows only the first line and not all the values inside.
How do I manage to make the subreport show all the values of the fields?

Related

If my SQL query in Crystal Report is not returning any data then how can I stop it from displaying

I want to stop printing of reports if no data is returned in Crystal Report. How can that be achieved?
One way to do this is to put the logic from the main report into a subreport. Then on the main report, right click on your newly created subreport and choose Format Subreport, select the Subreport Tabe then check the box that says "Suppress Blank Subreport".
That is one way to do it...

Crystal Subreport Common Headers

Maybe someone can Help me find the right technique.
I have a number of Crystal Reports that I am updating (Crystal Reports XI).
These reports each have an SQL Function associated with each that either retrieves records from the database (if any meet criteria) or returns an Empty Dataset (which happens daily).
These are executed in a batch process and directs the output to a PDF file which is emailed to users.
I am relatively new to Crystal Reports.
I am attempting to use a common SubReport to format/gather data for the Headers/Footers used in these documents. So far - most of this is working as I would expect. This allows me to use a single SubReport to generate the same Header/Footer in multiple reports (at least that's my goal).
However - I added a Report Footer section to the Main Report - my plan with this was to generate a Report Footer that would contain the following information:
A static Text Message that reads " --- END OF DOCUMENT ---"
The Report Title of the "Main Report"
The Date and Time that the Document was generated and Total Number of pages.
Sounds pretty simple.
So SubReport is named: "END-OF-DOCUMENT-SUBREPORT"
I used the "Special Fields" Data Date, Data Time, & Page N of M
Since the "Special Field" Report Title is returning me the "END-OF-DOCUMENT-SUBREPORT" value I used a Parameter field to pass the Report Title value from the Main Report to the SubReport.
This all works fine - HOWEVER - with the addition of the Linked Parameter Field from the Main to the SubReport - when I execute the report to generate the document - the SubReport ends up showing a blank Report Footer - that I can click on to reveal the "END-OF-DOCUMENT-SUBREPORT" in another Tab.
Without the Parameter field - it didn't do this and the information from the SubReport appeared on the last page of the document.
Is this a standard behavior of Crystal?
I'm not sure how to Suppress the "Drill Down" feature and still display the Report Section.
You can pass variable between you Main Report and sub Report. You can also create variable and assigned them to a sub report. As aMazing mention, creating Header and Report Footer sub report is not common. It is even messy. If you want something generic, I will create a report template that you will use in the future.
Have a good day!

Combine all SSRS reports in the Grid into one report

It should be very simple and should employ multi-value parameters , but not able to figure out how ? This report takes parameters from the GridView I have a gridview in an asp.net web page which has print button for every row to print this report for that row.
Now, there are as many reports as there are rows in the grid.---[This part is done]
So,how about combining all these reports into one single report
You can add a subreport for each one of you reports.
You just create a new report and start inserting subreports in each row.
Check this documentation:
http://msdn.microsoft.com/en-us/library/dd220581.aspx
Here's an example for you:
1 - Create a new report. You can then add a tablix to it, in case you have more info, which is the case in my example. Just don't forget to add a dataset to that tablix if that's your case.
This is how it would look
Each gray line is a subreport.
2 - To insert a subreport just right-click a cell and go to Insert > Subreport
3 - Right-click your subreport, select Subreport Properties and choose your report from the drop-down menu:
4 - You can then set the parameters your subreport will receive:
Case 2: if you don't need a tablix for aditional info, just repeat the same process in a Rectangle.
UPDATE
As I said in my comment, here's one report in which I do exactly what you want:
As you can see the subreports are part of the main report's body that has other data.
I need to repeat these subreports for each record and that's how it is done.
Here you can see the Id being passed as parameter to my subreport:
From what I understood, that's what you want. That way for each record its current Id would be passed to the report. Generating a report with that "dynamic" parameter you mentioned.

crystal report, subreport details section not displaying the next batch of records

I put a subreport in the footer of my main report and I set its details section to display five records per page (through the paging tab).
I am sure my query returns nine records.
Upon previewing the report, on the first page, it displays the first five records.
However, on the second page, it also displays the first five records not the remaining four records.
I am not sure where is the problem since I just started using crystal reports. Hope you can help me. Thanks.
You need to set your sub report links.
This will link the data from your main report to your sub report. In Crystal 2008 you right click on the sub report and choose 'Change Sub report links...' option. Then you can select the data to flow from the main report to your sub report. Otherwise your sub report is being viewed as a completely separate report that you are just inserting on top of your main report and it will be the same at every instance.
Also, it might be a good idea to use groups instead of the details section when inserting sub reports.

Multiple unrelated in JasperReports

I am using iReport with JasperReports. I want to include multiple subreports that have unrelated sql queries. I would like to be able to put these all on one report.
The problem I am facing is that when I leave the master report sql query empty, none of my subreports have any data. There isn't really anything that the master report sends to the subreports since they are unrelated. Basically how do you throw multiple unrelated reports together into one report.
In order for the Detail Band to show, you will need to fill the main report query, even if its just a dummy query, like say:
SELECT 'a' FROM DUMMY
This will make the Detail band appear, and with it all the sub reports.
Otherwise, if you don't want to use the Detail Band, you have the option to view the other bands without using a query. From Edit menu, choose Report Properties, under More... tab, set the flag When no data to All Sections, no detail