cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple base docnum in Invoice header

Former Member
0 Kudos

HI Experts,

I have an issue with the crystal report wherein I need to have the base docnum in my invoice form. I have multiple deliveries which copied to one invoice. I need the Docnum of deliveries to be place in my invoice header. I made a formula below which works fine in footer. What I need is to the header.

//Footer

whileprintingrecords;

global stringvar ConCat;

left(ConCat,length(ConCat)-1)

//Details

whileprintingrecords;

global stringvar ConCat;

ConCat := ConCat + Totext ({Command_1.docnum},0,"") +','

How can I do this in header.

Thank you.

RD

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Ardie,

That formula will never show the contents on the header due to the way CR evaluates formulas, sections etc.

To be able to display the output of the formula on the header, you would need a Subreport and a shared variable.

Try this:

1) Insert your original report as a Subreport and place it on the Report Header

2) Inside the Subreport, modify the formula on the Footer to:

whileprintingrecords;

global stringvar ConCat;

shared stringvar sh_concat;

sh_concat := left(ConCat,length(ConCat)-1);

3) Suppress all the sections of the Subreport

4) Back in the Main Report, reduce the size of the Subreport and make it so small that it appears no bigger than a dot.

5) Remove the formula you have in the Main Report's details and footer section

6) Create a formula with the code below and place it on the Header:

whileprintingrecords;

shared stringvar sh_concat;

P.S: Make sure this formula is place in a section below the section that holds the Subreport.

-Abhilash

Former Member
0 Kudos

Hi Ablilash,

Thank you for your reply. How about the details formula where I placed in the details. Should that formula remain in the main report? or all of the formula will be in the subreport and the only formula that will appear in the main report is:

whileprintingrecords;

shared stringvar sh_concat;

Thank you.

RD

abhilash_kumar
Active Contributor
0 Kudos

That's right. The Main Report will just have the formula on the Header, everything else will be in the Subreport.

-Abhilash

Former Member
0 Kudos

I'll try to do your suggestion and get back to you after. Thank you.

RD

Answers (0)