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

-E print "Invalid Export type." #9

Open
wtmh opened this issue Oct 16, 2017 · 4 comments
Open

-E print "Invalid Export type." #9

wtmh opened this issue Oct 16, 2017 · 4 comments

Comments

@wtmh
Copy link

wtmh commented Oct 16, 2017

When using -E print I get this output:

Report loaded successfully
Database Login done
Exception: Invalid export type.
Inner Exception:

Using anything else it prints fine, because well, those formats are accounted for.

Looks like it's currently not possible to print full stop. (I could be way off, I don't know C#.)

Observations:
In ArgumentContainer.cs, PrintOutput is set to false by default with no code anywhere else to flip it on:
PrintOutput = false;

In ReportProcessor.cs, Line 82, the _printToPrinter variable is assigned PrintOutput:
_printToPrinter = ReportArguments.PrintOutput;

In ReportProcessor.cs, Line 259, The _printToPrinter variable is tested here to see if it's being printed to paper and not exporting. But it is not possible to set to true. Specifying -E print is just setting an _outputFormat of "PRINT" which is of course invalid.

There really needs to be a condition the checks the input of that argument in the case of print being passed. Something like:
else if (_outputFormat.ToUpper() == "PRINT") _printToPrinter = true;

@mharned73
Copy link

I modified a local copy of the code and it works....

@fogoat
Copy link

fogoat commented Aug 15, 2018

Can you share what you modified and submit a pull request? Is the repo owner still active?

@gonerdoug
Copy link

I inserted

if (_outputFormat.ToUpper() == "PRINT") _printToPrinter = true;

at line 87 of ReportProcessor.cs and it now works to output to printer.

@mhertzfeld
Copy link

For anyone else who may be having this problem. The problem has been fixed in the fork below. Make sure to read the readme for parameter changes.

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

5 participants