Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify report to suppress column headers when data extend in next page

Status
Not open for further replies.
Aug 27, 2003
428
US
Hi,

I am using Crystal 9.0. I have to make modifications to the report as below.

There will be extra blank lines at the end of the report for users to have the ability to enter text. In this case, when the report flows to the next page owing to the extra blank lines, then the page header should be suppressed and only the column headers should be displayed.

Is this possible to do via section expert or a formula.

Thanks in advance for your help.

Regards,
junction123

 
Section Expert
Page Header
Suppress (No Drill-down) -> formula
put in Not(OnFirstRecord)

I believe this would suppress the page header except for the first page.
 
Sorry, I said it the other way round. I want to suppress teh column headers but show the page header in the next page in the case when report moves tot eh next page owing to the extra blank lines.

How can I achieve this? Thanks.

Regards,
Junction123
 
Move the formula to the section where the column headers are in the report (group header?). If you want to hide the page header on the first page, keep the formula there and remove the 'Not' function.

If the column headers and page header are in the same section, then you would have to supress each of the objects (using the above formula or the slight variation).

I hope this helps.
 
The page header is in a separate section. The column headers, I have two sets of column headers in two separate sections and based on hwat the user selects, the specific column header is displayed.

So based on your solution, I would need to add the formula to teh section that contains the column header.

Did I get it right? Thanks.

Regards,
Anita
 
You MUST identify the report sections that contain your column headers and also show the formula you are using to conditionally suppress one or the other.

Also explain whether this is really just a two page report or whether you are grouping and the comment section is at the end of each group.

-LB
 
LB,


The sections that will contain the columns are in Page Header b and Page Header c respectively.

I will use the above formula on both the sections based on the number of blank lines produced.

But now I have another tricky task to do .

If I have a parameter called Footer that will contain 1-50 lines. User may enter nothing, 1 line footer, 2 line footer or 50 lines in the footer.

For each line entered, I need to produce a blank line at the end of the report.

How can I achieve this?

Example I have a text box called Footer which is a paramter passed in the stored procedure.

Lets say I enter:

1. What is your name.
2. Where do you live.

The report should produce two blank lines at the end.

If nothing is entered then no blank line. If 50 lines are entered then produce 50 blank lines.


Can I do this via a formula in crystal?

Thanks in advaance for your help.

Regards,
junction123
 
Users will export report to pdf .

So assuming there are 132 characters in a line, can I use a Formula for say ?Footer:

IF LEN(?Footer) = 0 THEN produce 0 blank lines
IF LEN(?Footer) = 1 THEN produce 1 blank line
IF LEN(?Footer) = 2 THEN produce 2 blank lines


Can you help with the formula. I cannot think of another way but there maybe more efficient ways.

Thanks for your help.

Regards,
Junction123
 
Set up {?Footer} as a number parameter with options 0,1,2,50 and then add a description to each if you want. Then create a formula {@lines}:

replicatestring(chr(13),{?Footer})

Insert a text box and add your text and this formula next to it. Then format the text box to "Can grow" and also uncheck "Keep object together".

-LB
 
I tried teh below:

New Parameter ExtraLines as type Number.

Selected Discreet. Under Default Values have options 1 and 2.

1 Description set as This is Tom
2. Description set as This is John

I have a formula lines as

replicatestring(chr(13),{?ExtraLines})

When I run the report, I get a prompt to enetr Parameetr Values. How do get rid of this window?

Then when I select a number in the drop down

I get a value of 0.00 printed at the end of report.

I am doing somethign wrong but cannot figure out what.

Thanks for your help.

Regards,
junction123
 
Also, I want teh report to insert blank lines at the end based on the number of footer lines being entered.


If 2 footer lines are entered, then teh report should insert two blank lines at the end.

If 6 footer lines of text are entered, then the report should enter 6 blank lines at teh end.

Thanks for your help.

Regards,
Anita
 
That is what I explained how to do above. If you are using a parameter, you have to enter a value. I'm confused about why you think you wouldn't have to.

Please reread my post and follow the instructions exactly.

Or maybe the confusion is about the store procedure parameter. What is the prompt text for that? What exactly does that return as pick list values to choose from?

-LB
 
Stored Procedure parameter is as follows:

@CustText1 nvarchar(4000)

Used in Front End
DECLARE @ExtraLines nvarchar(4000)

Set @ExtraLines=
CASE
WHEN LEN(RTRIM(IsNull(@CustText1,''))) < 1 THEN NULL
ELSE RTRIM(@CustText1)
END

I have a front end meta data that acts as a repository for reports.

There will be a text box parameter called ExtraLines. This parameter comes from the stored procedure.

The reason behind the blank lines at the end of the report is that users want to be able to add their own text to the report in PDF or Word (when report is exported to pdf or word) When there are no lines reserved , then users find it difficult to type in text.

So the text box parameter ExtraLines will have a number between 1-50 depending on how many footer text lines user wants to enter.

For example if user wants to enter 2 footer text lines, then he or she will enter the number 2 in the text box parameter labelled ExtraLines.

Then crystal formula should be smart enough to insert same number of blank lines at the end of the report as the number entered in the ExtraLines parameter text box.

I will try to use the formula above, but if there is another approach, then please help. If any of the above is not clear please let me know.

Thanks for your help.

Regards,
junction123

 
I tried the below formula.

I inserted a new parameter ExtraLines as a number type.

I have a formula FooterTextLines

IF {?ExtraLines} = 1 THEN 1
ELSE
IF {?ExtraLines} = 2 THEN 2
ELSE
IF {?ExtraLines} = 3 THEN 3

I have another formula ExtraBlankLines

replicatestring(chr(13),{?ExtraLines})


I inserted a new section, inserted a text box and inserted the above formula.

I am getting a prompt for the parameter ?ExtraLines

Please help, thanks for your help.

Regards,
junction123
 
Just use the Extra Lines parameter from the stored procedure directly in the replicatestring formula. Don't create a new parameter.

-LB
 
LB, I tried this ....

In the stored procedure, I have the ExtraLines paramter nvarchar(4000) in the final output.

In the XSD, I have added this as a column.


In the report: I have the below formula FooterTextLines


IF {Detail.ExtraLines} = '1' THEN 1
ELSE
IF {Detail.ExtraLines} = '2' THEN 2
ELSE
IF {Detail.ExtraLines} = '3' THEN 3


I have another formula ExtraBlankLines as

replicatestring(chr(13),{@FooterTextLines})



Then I inserted a new section at teh end of the report.

I inserted the formula in the section

@ExtraBlankLines.

What else am I doing wrong or what else should I do?

Thanks again for your help.

Regards,
junction123

 
Curious. What does the replicatestring(chr(13), {}) do?

In order to insert same number of blank lines, how does usig the above help?

Apologies for asking these questions but I want to ensure I understand the formula.

Thanks for your help.

Regards,
junction123
 
I also tried somethign like this formula.

I inserted a text box in the new section at the end of report. Then I inserted teh above formula @FooterTextLines.

Still no luck, I do not see a blank line when I enter 1 in the front end.

IF {Detail.ExtraLines} = '1' THEN " "
 
Change the formula to:

replicatestring(chr(13),tonumber({Detail.ExtraLines}))

You don't need a translation formual. Then add it to the text box with the text, and format the text box to "can grow". I don't think you took the last step.

-LB

 
I changed the formula to

replicatestring(chr(13),tonumber({Detail.ExtraLines}))

Iinserted the formula in the textbox.

I checked CanGrow.

I just have one formula

When you say "with the text" what do you mean? Do I need to add Detail.ExtraLines in the textbox and the formula @FooterTextLines next to Detail.ExtraLines?

I do not understand. Pelase clarify.

Thanks for your help.

junction123
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top