Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Parameter Passing to the one crystal report rpt file #45

Open
ayeayemaw08ucsy opened this issue Oct 3, 2019 · 7 comments
Open

Comments

@ayeayemaw08ucsy
Copy link

ayeayemaw08ucsy commented Oct 3, 2019

I want to pass dynamic parameter to one crystal report rpt file . For example I have 250 branches and i want to pass parameter with looping from command line. The crystal report file is used with the dynamic parameter field .When i export the rpt file from crystal Ninja with parameter which is map with rpt's file parameter file parameter .If parameter is same , the report of pdf format is successfully generated .When I passed the second parameter with looping ,the follwing error is occured.
image

@ayeayemaw08ucsy ayeayemaw08ucsy changed the title Dynamic Parameter Passing per one crystal report rpt file Dynamic Parameter Passing to the one crystal report rpt file Oct 3, 2019
@mhertzfeld
Copy link

Odd that you would be getting a log on error on the second execution but not the first.

Make sure the option to save data within the crystal report is unchecked.

It may help with troubleshooting if you post your entire script including how you are performing the loop.

@mishrasatyam
Copy link

mishrasatyam commented Oct 9, 2019

I am also getting same issue.
command:
CrystalReportsNinja.exe -u username -p password -f filename.rpt -E pdf -a "parameter1:value1" -a "parameter2:value2"

1.If parameter value is same as parameter value in .rpt file, then pdf is generating successfully.
2.If parameter value is different from parameter value in .rpt file, then pdf is not generating and I am getting following error:

Error in File filename 15888_14948_{EEA9A5DC-1293-4441-A9B9-6D37AC82DF6E}.rpt:
Failed to load database information.
Error in File filename 15888_14948_{EEA9A5DC-1293-4441-A9B9-6D37AC82DF6E}.rpt:iled to load database information.
Failed to load database information.
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

@ayeayemaw08ucsy
Copy link
Author

Odd that you would be getting a log on error on the second execution but not the first.

Make sure the option to save data within the crystal report is unchecked.

It may help with troubleshooting if you post your entire script including how you are performing the loop.

Hello mhertzmeld
You suggest that "Make sure the option to save data within the crystal report is unchecked."
That meaning is i need to be prepared manually for 250 rpt file of 250 branches parameter. But rpt file template is same and only different in parameter .I don't want to do like that manually.
That why I use looping and pass parameter dynamically from CrystalNinja to one rpt file.

If you have any idea for above scenario ,Please Let me know. If any other csharp library file for that case ,pls let me know.

Thanks
AAM

@mhertzfeld
Copy link

You should only need one crystal report file, your template. You will loop through your list of branches and execute ninja for each branch, specifying the branch in the parameter.

Also, if you are using the 64bit version of Ninja you need to make sure that you are using the 64bit version of the ODBC driver, or if you are using the 32bit version of ninja you need to make sure you are using the 32bit version of the ODBC driver.

@mishrasatyam
Copy link

Hi, @mhertzfeld can we have skype call regarding this if you don't mind?

@ayeayemaw08ucsy
Copy link
Author

You should only need one crystal report file, your template. You will loop through your list of branches and execute ninja for each branch, specifying the branch in the parameter.

Also, if you are using the 64bit version of Ninja you need to make sure that you are using the 64bit version of the ODBC driver, or if you are using the 32bit version of ninja you need to make sure you are using the 32bit version of the ODBC driver.

Hello mhertzfeld,

I have been already tried on 32 bit verson of Ninja because of our crystal server is used 32 bit ODBC driver.Same Error are coming. Do u have any idea to overcome this error.

image
Can u help me ! If possible , can u give me a few session of skype discussion with my team.

Thanks
AAM

@mhertzfeld
Copy link

I will not have time for a call until next week. I will try to help you here for now.

I've never worked with an Oracle DB before. I typically work on SQL Server and DB2. But the DB you are using shouldn't really matter to Crystal or Ninja. However the way you are trying to connect to the DB may matter.

On the first execution where ninja is running ok, do you think ninja is connecting to the database and pulling data from the DB or do you think it may be using data that has been saved in the rpt file? It doesn't make sense to me that on the first execution you would be able to connect to the database and pull data ok but on the second execution you would be having problems connecting to the database. Especially if the script is essentially the same except for the branch number being different.

Disable the "Save data in report" option and run it for a branch 1 where it was executing ok. Do you get an error now?

Are you able to try using an ODBC DSN instead of a JDBC? Here are some issues related to Oracle and JDBC.

#4
#15
#34

Also, once you get this working you may want to look at my fork of Ninja. It has some additional features and bug fixes that aren't in the original version of Ninja. The newest branch I am working on will make it easier to run Ninja using PowerShell (see the powershell portion of the readme).

https://github.com/mhertzfeld/CrystalReportsNinja

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants