Force Page Break before Row based off formula? - crystal-reports

I am new to crystal reports. I have built a simple report that is populated by values from a stored procedure. I'm trying to place a page break before the row if the value of one of the returned items from the stored procedure is equal to a specific string. Is this possible? Thanks in advance.

Depending on your version of Crystal Reports, in the Section Expert under the Paging tab you should have the option to specify page breaks using a formula.
Hope that helps,
Chris

Yes this is possible. Right click on the section like Report Detail, Report footer etc and there will be an option to insert page break.
Against that option there will be a symbol of formula.
In the formula, specify the formula:
if(Report field...)="comparable string"
then true
else false
And you are done. You can ask again if this is not clear.

you can break a page using section expert.
Steps for produce:-
Right Click on Detail Section->Click on Section Expert->Click On Paging Tab->select CheckBox(New page Before) ->Click on Formula Button.
here will open a popup window and put below code in formula window.
if{YOUR_REPORT_FIELD_NAME}="xyz" then
True
else
False
when your field value find "xyz" then page will be break.
if want any clarification , please comment.

Related

CR | Open subreport by clicking on database field in main report

this case is a little more difficult I think.
In my main report I have material numbers displayed in a cross table.
From time to time I need to show more details for one of the material numbers. Therefore I want to double click this field and then copy the corresponding material number to the sub report (directly in the parameter field). Another fixed parameter field is the date, which has the max date "today" and the min date "today-365d".
Moreover I donĀ“t want to make the sub-report visible in the normal report the whole time. It should just be visible if I double click a material number.
Is there any possible way to that?
Thanks in advance!
You can do this in 2 ways, with either an on-demand sub report or by utilising the drill down
Using sub reports
In your main report go to insert>Subreport. Create your sub report with the detail you wish to see, then click the tick box for "On-demand subreport". Place the sub report in the details section along with your material numbers. You'll see it appear like a hyperlink. Right click then Format Subreport>Subreport tab. You can change the Subreport caption to the material number from your data by clicking the formula button for "On-demand Subreport Caption" and entering your material number field name as the result of the formula.
Whjen you ruin the report you can click the link to see the etail in the subreport
Drill down method
Create a report with all the detail you need in the details section. Group by material number then in section expert (Report menu) use the tick box to "Hide (Drill-Down OK)" the details section. Now when you preview the report the group header will show with the material number, clicking this group header will open the details section.

Crystal Reports 2013: Formula field will not display on page

I have a formula called PickOutstanding. Here is the code:
if OnLastRecord and {#Calc} < 0 THEN
toText({#shipctns}-{#RTotal0}) & " Outstanding"
which works on the report but does not show. For example:
In the first image is my report, with where #PickOutstanding is highlighted
#PickOutstanding does not show. However when I click into it:
It clearly is showing right there. What could be causing it to be hidden on the report itself and how do I get it to show?
Full images in case it is difficult to see the difference between pictures
Pic1:
And Pic2:
It was an oversight on my part. OnLastRecord was only working on the very last record in the report. Did not work multi group. Will look into getting it to work per group.

Why my jasper report values are only on first page?

I am newbie in jasper report.
I have a problem regarding with jasper report. The values results from query must be on the second page instead of over crowding at the first page but I can't make them go to the next page. I mean they are overflowing with each other at the first page. Nobody wants to another page. :( thanks in advance
You did not provide codes. My guess is the position type is not set to float. Go to properties of the element thats overflowing then set
Position Type : Float
You have to keep all the text field in "Summary Band" to get all the results from query.

Suppressing subreport with no data and a header

I have a fairly simple subreport that I want to suppress when there are no records selected for it. The problem is that I have a header and footer section of this subreport with static elements in it (text boxes, lines, etc.). I have set the section containing the subreport, the subreport itself and the sections within the subreport to all be surpressed when there are no records. Yet, the subreport shows up anyway. The data section with no data is indeed suppressed but the headers and footers seem to keep the subreport visible.
Any ideas? Oh, I'm running Crystal-Reports 2011. Thanks!
I just ran into this myself in CR2008. Here are the steps I did to make this work:
Go into your subreport (by that I mean have it open in its own designer window) -> go into 'Report Options' under the 'File' menu -> select 'Suppress printing if no records'
Now go back into your main report. Right-click on the subreport -> go to 'Format Subreport' -> hit the 'Subreport' tab -> check the 'Suppress Blank Subreport' checkbox.
If the subreport is the only thing in the main report section, go into that section in the 'Section Editor' by right-clicking on it -> check the 'Suppress Blank Section' checkbox.
EDIT: If your subreport does return records but it is just that none are displayed then try using shared variables. To do this you need to consider the logic you're using to display the records in the subreport in the first place. This is likely whatever logic found in the detail section suppression formula, but it will depend heavily on the format of your particular subreport.
Now, initialize a shared numbervar in your subreport's report header and then increment it each time a row is displayed using the aforementioned logic.
Back in your main report, you may be able to check the value of that variable to conditionally suppress the subreport's section. I say "may" because CR may not evaluate the subreport's variables prior to looking at the suppression formula, but give it a whirl. You'll want to use the whileprintingrecords; keyword in your section suppression formula to delay its evaluation. Good luck!
Have you tried using suppress formula?
Right click Format Field > Check Suppress > click Edit formula [x-2] button
Hard to follow everything in the post but if data is running into each other, then add a section and place your sub report in the section and make sure can grow is checked off.
If you have static data that you want to show, then you may want to create 2 sub reports, one with the static data and one with the dynamic data and suppress if blank.
Put subReport in a Section, then Right click on Section=> Section Expert
Then check true 'Supress Blank Section' in the common tab as mentioned in below picture.

Inserting a Page break into an SSRS report

I have a report in SSRS that contains 12 subreports. After each subreport, I need to insert a page break so that each subreport starts on a new page and doesn't share pages with the other subreports. Does anyone know how to do this? Thanks
I found an answer. Use a Rectangle at the bottom of each SubReport after all Tablixes and other rendering Objects. Then set its "PageBreak" property to "End". When the SubReport is finished with the Tablix and/or other data objects, the Rectangle forces a page break. Also, a cool feature, if the SubReport returns no rows of data, the page break is not rendered. Therefore, no extra page breaks
Another solution would be to have the subreports placed inside the rectangles. I would imagine this would help you to better control and organize the layout of the report.
I tried the other answer here but my master report is driven by a dataset so didn't quite work out. This is how I got it to work for me:
1) I put the subreports into different rows on top of same size rectangles inside a Tablix with all the rows belonging to the same row group.
2) I then selected properties of the group, then pagebreak and checked the property pagebreak on between each instance of group.
Just use the "Add page break after" on the General tab of Tablix Properties.
I came across the same kind of issue but I was able to overcome by below mentioned way.
I created a sub report and placed rectangle inside the sub report (page break option checked before) and placed all my sub report content inside the rectangle. This page break works only if the sub report renders any data if not they will be no page break.
I have made Many reports with a front Page Summary and Page 2 with the Detail.
Use the Tablix for the Page Break
Tablix > Properties > PageBreak > BreakLocation > Start / End / ......
Like other answers mention, I used the "Page break before" option on rectangles/tables, but for some reason it would only break the page if it wasn't at the very top of the (sub)report