I am having troubles creating CR report with multiple pages.
What I am trying to achieve is:
Page 1: report
Page 2: same report with different header
Page 3: still same report as page 1 with different header
Page 4: same analogy
Now my reports is designed for 1 page.
Any tips? I'm little frustrated ATM...
You're going to need 4 Page Header sections. Each section will use a formula to be suppressed based upon the page number of the report. Each Page Header will be configured in the unique design needed for each of your 4 pages.
If you only have 1 row of data in your database that needs to generate all 4 reports, then you will also need 4 Details sections that use the same formula to be suppressed by page numbers. The design of the details sections will all be identical.
At some point you will also want to set the "New Page After" check box on a section. This can be done on each of the 4 details sections, or in the Page Footer sections if you use them. If you use Page Footer sections, they will likely need to use the suppression formula by page number as well.
This setup will yield 4 pages of the same data on each page, with unique page headers.
The complexity of your suppression formula will vary depending upon how much data you plan to print with each run of the report. If it will only be 1 report with a total of 4 pages then the formula will be rather simple since you only need to check for 4 possible values of PageNumber. If you plan to print multiple reports in this manner per run, then you need to check for PageNumber values that are multiples of 4 + n, where n is either 1, 2, 3, or 4. This still isn't an incredibly complex formula, providing you are 100% certain that none of the 4 pages needed for each row of data will ever exceed a single page. If that happens, the complexity of the report becomes much greater.
Related
I am actually stuck with a multiple tables problem. I want to display 2 tables in my report.
I saw how to do it with C# but I am not using C#, only Crystal Reports. So I have to manage to do it inside Crystal Reports. Is there any way to do it other than use 2 sub reports?
Because from what I understood (I am very new to Crystal reports): to make a table, you have to put the header of the columns in a Header section and the datafields in a Details section.
But when you create sub groups, you can't add Details sections to each group, right?
What I want is something like that:
Example of what I need
How should I organize my report (in the section expert) to manage such a thing?
Thank you very much to anyone that can help!
You may be overthinking the details sections. When you group data in Crystal Report you get a Header and Footer section for each grouping level. So if you have 3 grouping levels, the report has the following sections.
Report Header
Page Header
Header 1
Header 2
Header 3
Details
Footer 3
Footer 2
Footer 1
Report Footer
Page Footer
In this report layout the details section contains detail records for Header 3 data. The data for Header 1 is detailed in Header 2, and the detail for Header 2 is found in Header 3.
The table layout you want to use is probably going to require at least 1 subreport. You may be able to pull the data for the first table along with the report data that is a higher level than tables, but you may need to do 2 subreports to prevent duplication of the data. I would focus on getting each table working in individual reports first, then you can link them into another report as subreports once you have both tables displaying the way you would like.
So basically I have a report. I need this report to be printed as a 'set of reports'. Except that for each time the report is printed, there has to be a specific numbering at the bottom of the page. Where it would look something like this:
Page 1: Report + Page footer text 'Number 1'
Page 2: Conditions
Page 3: Report + Page footer text 'Number 2'
Page 4: Conditions
Page 5: Report + Page footer text 'Number 3'
Page 6: Conditions
And so on, for an undetermined amount of times..
In order to achieve this, I have created a main report, which currently contains 20 subreports, in order to achieve 20 pages (but I really I'd like this to be dynamical, maybe to be able to set the number of copies or something). Where each subreport consists of the single mentioned report (through the subreport 'Choose an existing report' option), with a custom text at the bottom.
The problem with this is that I can't maintain this. Every time an adjustment needs to be made to the original report, I will need to access 10 subreports and make the very same change or reload the report into this subreport.
What alternative ways of achieving my goal can you suggest, because this feels really 'dirty'. Thank you for reading.
I run Version 14.0.2.364 of Crystal Reports 2011
To achieve this, you need to use group and detail section in main report. For making adjustments with paging, each section has his own
page before
page after
reset page
So to help you a bit, you need to have your data in one datasource, and group by
Report/Conditions. For each group you can have only 1 subreport which will have link for that specific subreport (e.g. where barcod of smth is 1234) and there show your subreport data. For page number i would advise you to use my approach (for grouping) and then for page number you display group number (and that solves you all formulas for calculating pages).
If you are not familiar with grouping in Crystal, you can group your records in report by some fields by following image below
To summarize, try to define by which fields your reports has 20 subreports (probably some keys from database) and then group by that fields, examine advances of section expert and paging and you should be done in few hours making your report readable and easy to maintain.
Hope it helps
I have a report that is only one record, however, the user specifies how many times it needs printed, let's say 10. Each time it prints it prints 4 of the same report. Like this, Page 1 x 4, Page 2 x 4, Page 3 x 4, etc. With 10 copes their will be 40 pages altogether.
Update:
I was able to get all the pages I needed based on the values the user inputs. So if there are 10 pallets I have 40 pages of labels, which is correct. Now the control number part that needs to be displayed. It is kind of like a page number but every 4 pages the number needs to increment by 1. I assume I can use WhilePrinterRecords and some how increment, but I am still new to Crystal and unfamiliar with it.
Example:
Page 1: Control number 1
Page 2: Control number 1
Page 3: Control number 1
Page 4: Control number 1
Page 5: Control number 2
Page 6: Control number 2
Page 7: Control number 2
Page 8: Control number 2
This would continue until there is no more pages to print.
if you want 4 copies for each label, what you could do is create 4 sections on the report with the same info. Make sure that you assign the label size to each page(e.g. 4x6). e.g. if you have that info on your header, create PHa, PHb, PHc and PHd, same for details or PF.
don't know if this could work for you, but at least is a recommendation. You can create suppressed sections with the same info(e.g. 10 sections) and create a parameter that control that suppress condition defaulted in 4. If the user what to print 5, it will enable section 5th, same if want to print 3 it will suppress the 4th.
Upadte: how to get the increment:
place a formula on your page footer like below one. It will return value when gets an integer and suppress it when is equal to 0(right click on it, number tab, customize, suppress if 0).
if pagenumber = Ceiling(pageNumber,4) then numbervar page := page +1
then place another formula on your PF as well like below one and suppress it when pagenumber = Ceiling(pageNumber,4) so it won't show when the other has value and put one overlapping the other to get the value in the same place.
if {1st formula} <> 0 then numbervar page1 := {1st formula};
page1 + 1
2nd Update:
Because is a label and your details are acting as a new page do this:
create a new detail section, so you will have details a and b and place your formulas on details b
I have used additional tables for such tricks; these tables must be linked to report to multiply main query results. Some care has to be taken to not allow multiple users printouts to mix.
Example, assuming your report query has some unique id to link and your user/session has also some unique id:
you create table cr_special(reportid int, userid int, ctlnumber int)
you design report, linked to this table by reportid and filtered by userid; changing ctlnumber field is taken from your special table
before printing, you delete all records with reportid/userid combo and insert new ones
you print report, giving userid as parameter
Say you want to print 10 reports with increasing numbers - then you insert 10 records into your special table with ctlnumber increasing from 1 to 10.
Variation of this solution is to use some other non-related table, like our all-dates-containing dates table :)
Both of these solutions are ugly, but they usually work.
Another approach is to use some stored procedure to return these sequential numbers as records and link your report to such procedure; Crystal Reports and stored procedures do not behave always well however.
I have develped a crystal report. It must have 4 pages as default and additional 2 depending on the condition.
When the condition is success its showing all the text objects in 5th and 6th pages correctly, but in else condition, its displaying 4 pages with appropriate data and empty pages having page header in last 2 pages.
How to suppress/completely hide last 2 pages?
Pls advice
Thanks
Your best bet would be to create a report with multiple report footer sections. You can then either adjust each report footer section to be 1 page high and add the relevant conditions and objects or alternatively add a subreport to each report footer section containing the fields/logic.
I would probably create 8 report footer sections (2 being blank) then decide whether to show the 2 blank ones or the 2 with relevant objects.
In section expert, next to suppress use the below formula
if pagenumber in [99,100] then true
else false
Note; Assuming 99 and 100 are last 2 pages of the report.
I might be very stupid to ask this question. But I really hav no idea how to do it.
My boss wants to get a crystal report and he wants 2 formats.
that means he wants summary page on page 1 with one format and details page on page 2 with another format.
So I have been thinking two ways.
1st way is to get 2 formats in 1 crystal report. I hav never done that before and I couldn't find it online.
2nd way is to do 2 crystal reports and combine them. I hav no idea how to do that also.
So anybody can help?
may b both of my ways may b wrong.
Any suggestions?
The ways I can think of (depending on the complexity of the summary requirements) are:
Include value totals in the report heading, with a page break at the start of the first report group.
Include a crosstab with the summary details in the report heading section.
Insert a subreport in the report heading section.
Ok.. I m the one who asks the questions. I know what to do now. and for the sakes of others (beginners like me), I share my experience.
Crystal reports doesn't allow you to have 2 formats in 1 reports.
Cyrstal reports doesn't allow you to export 2 different reports (not subreports) at the same time.
So.. I would do like this.
First, if I want to get 2 different reports, like Summary Page on 1st page and Details Page on 2nd, I will use subreport. But subreport will redirect u to that report itself when u click on it.
I dun want that either.
So I will cover subreport with text object with no background.
But I can't adjust the height of that text object.
I will use this
IEnumerator ie = mycrystalreport.Section1.ReportObjects.GetEnumerator();
ie.Reset();
while (ie.MoveNext())
if (ie.Current != null && ie.Current.GetType().ToString().Equals("CrystalDecisions.CrystalReports.Engine.TextObject"))
{
CrystalDecisions.CrystalReports.Engine.TextObject to = (CrystalDecisions.CrystalReports.Engine.TextObject)ie.Current;
if (to.Name == "my_text_object ")
to.Height = "the number you want. might need to calculate";
}
Good luck