prashant prashant - 1 month ago 7
ASP.NET (C#) Question

How to remove blank line in Crystal Reports?

- col1 Col2 col3
- 1 A 1
- 2 B 2
- 3 A 1
- 4 B 2


I wrote the formula like as shown below

Local CurrencyVar colvalue := ToNumber ({storedprocedure;1.col3});

If colvalue = 1 Then
(
{storedprocedure;1.col2} ;
);

Local CurrencyVar colvalue := ToNumber ({storedprocedure;1.col3});

If colvalue = 2 Then
(
{storedprocedure;1.col2} ;
);


And also tried using text object field making "suppress embedded filed blank line" but still not displaying as required.

Please suggest how can we achieve it.

Required output(1), As displaying(2)

Answer

It is not blank line it is the formula that is producing that blank space as there is no data to perform for the formula if if condition fails.

To overcome you need to take two sub reports and place them side by side without any gap in detail section.

Sub report 1:

Create a formula @Formula1 and write your first part of the formula

Local CurrencyVar colvalue := ToNumber ({storedprocedure;1.col3});

If colvalue = 1 Then
(
    {storedprocedure;1.col2} ;
);

Go to record selection formula of the sub report and write below code:

{storedprocedure;1.col3}=1

Sub report 2

Create a formula `@Formula2 and write your first part of the formula

Local CurrencyVar colvalue := ToNumber ({storedprocedure;1.col3});

If colvalue = 2 Then
(
    {storedprocedure;1.col2} ;
);

Go to record selection formula of the sub report and write below code:

{storedprocedure;1.col3}=2

Remove borders for sub report

Comments