rainforestnet / CrystalReportsNinja

A small Windows Console App that loads external Crystal Reports file, takes parameter inputs and export to various format or even print to printer
http://www.rainforestnet.com
96 stars 79 forks source link

Running CrystalReportsNinja in Php #2

Open abnertole opened 7 years ago

abnertole commented 7 years ago

Hi,

Thanks for sharing the tool. I have tried it and encountered the error below.

When I run in windows CMD, the crystal report is generated. But when I execute via Php exec(), I am getting the error below. Anything I missed out?

Exception: Unknown Database Connector Error Error in File OPRJ 94969704{1CA7AD4F-AFE6-4FA9-8840-B945674BF453}.rpt: Unknown Database Connector Error Inner Exception: System.Runtime.InteropServices.COMException (0x800002C2): Unknown Database Connector Error Error in File OPRJ 94969704{1CA7AD4F-AFE6-4FA9-8840-B945674BF453}.rpt: Unknown Database Connector Error at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

Thanks.

Abner

rainforestnet commented 7 years ago

@abnertole I have never tried to use php to run a .net executable before. I am not sure of that. I did have a asp.net project that call this and it works.

fmartiner commented 6 years ago

@abnertole Set the correct ORACLE_HOME and TNS_ADMIN path in environment variable before launch cmd of CrystalReportsNinja.exe from PHP Example create a .bat file with:

SET ORACLE_HOME=C:... SET TNS_ADMIN=C:... CrystalReportsNinja.exe -F ...

and exec(file.bat)

This solve for me.

mikecrf121 commented 5 years ago

@rainforestnet curious, how did you run this from another .net application?? did your app open a command line and then pass strings to the console, im considering doing something simular ??

mharned73 commented 5 years ago

Opened from a exe statement is SQL Server Stored Procedure…. The command is passed as a string

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: mikecrf121 notifications@github.com Sent: Thursday, August 29, 2019 6:52:49 AM To: rainforestnet/CrystalReportsNinja CrystalReportsNinja@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [rainforestnet/CrystalReportsNinja] Running CrystalReportsNinja in Php (#2)

@rainforestnethttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frainforestnet&data=02%7C01%7C%7C3365a096a66e46f93f8608d72c7fcc58%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637026799701597168&sdata=VgDtxa4VOdOOdNrN45TXCnR%2BA2Cl2LgDDGuTao3NdtE%3D&reserved=0 curious, how did you run this from another .net application?? did your app open a command line and then pass strings to the console, im considering doing something simular ??

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frainforestnet%2FCrystalReportsNinja%2Fissues%2F2%3Femail_source%3Dnotifications%26email_token%3DAHU7HXOIP6WJXMXSJR4KT33QG7BCBA5CNFSM4DZFT67KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5OLWPQ%23issuecomment-526170942&data=02%7C01%7C%7C3365a096a66e46f93f8608d72c7fcc58%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637026799701607173&sdata=uesJnAkhI84BjktJ34zf03uPBV%2FOCUggyMfvh7UMQ8w%3D&reserved=0, or mute the threadhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHU7HXOGY235ETFB3DOREG3QG7BCBANCNFSM4DZFT67A&data=02%7C01%7C%7C3365a096a66e46f93f8608d72c7fcc58%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637026799701617190&sdata=xNBd9rp6YgNPTNMECtx6XK9eBmobJXwvycsI4%2FmSSr8%3D&reserved=0.

rainforestnet commented 5 years ago

@mikecrf121 check this out https://stackoverflow.com/questions/9679375/run-an-exe-from-c-sharp-code

mikecrf121 commented 5 years ago

appreciate it thank you! what im trying to do is receive a json object, parse it with a node app and feed it to CRN. very useful library good job!

mikecrf121 commented 5 years ago

@rainforestnet hey quick question, just now running into this issue, is this able to work with generating reports that contain sub reports?

Thanks!

mharned73 commented 5 years ago

Yes.... from the point of executing runtime it is just crystal reports

Get Outlook for Androidhttps://aka.ms/ghei36


From: mikecrf121 notifications@github.com Sent: Wednesday, September 4, 2019 6:22:42 AM To: rainforestnet/CrystalReportsNinja CrystalReportsNinja@noreply.github.com Cc: mharned73 harnedmark@hotmail.com; Comment comment@noreply.github.com Subject: Re: [rainforestnet/CrystalReportsNinja] Running CrystalReportsNinja in Php (#2)

@rainforestnethttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frainforestnet&data=02%7C01%7C%7C7c726bdd914f4f154d0008d7313295c4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637031965631478143&sdata=JN%2FfYwmX5uGqimTIEIl%2FCrFga2VxZ4dtvP%2BTbsPT0JI%3D&reserved=0 hey quick question, just now running into this issue, is this able to work with generating reports that contain sub reports?

Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frainforestnet%2FCrystalReportsNinja%2Fissues%2F2%3Femail_source%3Dnotifications%26email_token%3DAHU7HXISMB2KGJHJHLLCLBTQH6SBFA5CNFSM4DZFT67KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD53MDPY%23issuecomment-527876543&data=02%7C01%7C%7C7c726bdd914f4f154d0008d7313295c4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637031965631488154&sdata=ypvt%2FhQEUlRdgTucW0QbussNz3aMtJp66eld1FsKoDI%3D&reserved=0, or mute the threadhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHU7HXMUQXLYEHYHVMYX5GTQH6SBFANCNFSM4DZFT67A&data=02%7C01%7C%7C7c726bdd914f4f154d0008d7313295c4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637031965631498159&sdata=zJoglxzQdFOV%2FlZEw1dkSNH8tDssiSsRCxIMJ04%2F4Jo%3D&reserved=0.

aj1432 commented 2 years ago

hello team Please Explain Step by Step Please I do not understand Command.

please check attachment, I got error image

mikecrf121 commented 2 years ago

@aj1432 What do you mean you don't understand command? Like you can't run CRN at all or you don't understand the parameters? I haven't worked with CRN in years... but this is an amazing amazing program, especially to save money if your facing the same problem my company did at the time. You need to compile it first, what are you using to do that?? If you dont know what im talking about or how to even do that to make code changes if needed then id suggest hiring someone who knows what they are doing, like me haha. Your also trying to run ,from your screen shot the first time with no required param "-F"... If you want I can show you on a one on one with a zoom call? I may charge you to refresh myself though. What are you trying to use crystal report ninja to do? I remember when I did it for the company I was working for a few years ago, we built a custom angular app, with a node backend that executed CRN from the node app and returned the generated crystal reports to AWS S3, and we utilized sqs, sns, lambdas, etc... but anyways we built this app to avoid ridiculous licensing costs associated with generating crystal reports from some program, it was like a per user cost that our company was trying to save money by avoiding the high costs of multiple licenses. I'm also able to build out an app for you if your hiring or interested in contracting me. Can be part time or for a few hours, depending on your needs. Thanks and good luck.