Link to home
Start Free TrialLog in
Avatar of RSchnabel
RSchnabelFlag for United States of America

asked on

Retrieving data from RPGLE programs into Crystal Reports

I have been using Crystal Reports to report data from DB2 tables on an iseries for a long time, both using the database wizard and writing my own SQL commands. What I would now like to do is to call a utility program on the Power 9 and retrieve the output and incorporate it into a Select statement in CR to then display in a report. I will need to pass a number of values including both strings and numbers. My first thought was that maybe there is a way crystal can use a stored procedure syntax to call an rpgle program, but I have no idea how this will work, and I have not been able to find an example or two. Can you point me in the right direction? One of my goals is to utilize programs for calculating shipping & tax charges that already exist on the power 9 box by passing in customer numbers and shipping terms and methods, and order info.
Avatar of lcohan
lcohan
Flag of Canada image

In my opinion you could use  parameterized crystal reports as described here https://www.kb.blackbaud.com/articles/Article/54043 or create view(s) in DB2 and use them as for example as described here https://stackoverflow.com/questions/18793569/crystal-reports-can-it-use-a-stored-procedure
Also found the way to call a stored procedure but as I don't have access to CR+DB2 at the moment I can't test it although the steps should be like go to database expert, select your connection and click on add command then in there you need to create parameters the parameters needed for your stored procedure call which would be like:

{CALL 'schema_name'.'sp_name'({?delay_time})}
where 'schema_name'.'sp_name' is the stored procedure and and 'delay_time' is the parameter.
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RSchnabel

ASKER

Thank you both for your help.  Gary your links were very helpful as they not only told you what you can do, but also how you do it. Thanks.