Showing results for 
Search instead for 
Did you mean: 

SAP B1 - Field returning null when exporting PDF of crystal report, works fine in preview.

0 Kudos

I made a crystal report which pulls data from 4 tables: "OCPR", "OCRD", "OQUT" and a UDT "_Custom_Table".

The links are

"_Custom_Table"."U_CardCode" -> "OCRD"."CardCode", Inner Join
"_Custom_Table"."U_CntctCode" ->"OCPR"."CntctCode" Inner Join
"_Custom_Table"."U_Quot_ID"->"OQUT"."DocNum" Inner Join

When I preview the report in Crystal Reports it works without issues, same when I use the "Preview External Crystal Reports File" function.

When I import the .rpt file as a report layout and click the PDF button it does not work unless I remove any fields from the OQUT table. It generates a pdf with blank values in place of the Database Fields. When I remove the OQUT fields it works without issues.

I changed the OQUT link to Full Outer Join and that caused all the fields from the other tables to be populated. The fields I need from OQUT remain empty.
This caused me to believe that for some reason B1 cannot retrieve the data so I copied the SQL query from Crystal and I ran it in the Query Generator. All the values were correctly returned.

So in short, the report works in Crystal and "Preview External", it does not work when generating PDF.

This has me completely stumped, any ideas would be greatly appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

Active Contributor
0 Kudos


if you run your SQL statement in MS SQL Studio, do you obtain the right results?

If you try with LEFT JOIN, do you obtain the right results?

Kind regards


0 Kudos

The query works on MS SQL Studio, both with inner and left outer join.
In B1, changing to LEFT OUTER JOIN:
Preview external crystal report: Everything works
Export PDF: OQUT field is null, every other field works.

Thanks for the response