Jump to content
Macro Express Forums

Recommended Posts

I have a series of Crystal reports I need to send to a specific printer each morning at a designated time (with finishing options such as double sided and stapled). I haven't been able to find options within ME Pro to allow me to do this. Has anyone successfully accomplished a task like this yet? If so, can they share with me the specifics on how to do it?

 

Much appreciated!

Share this post


Link to post
Share on other sites

You might not need MEP. I believe CR has command line properties that allow one to do many things including running reports. I would first look and see if that's the case and if so, use the Windows Scheduler to schedule the task every morning. If there's no option to directly print, you could create a report file in a batch file and then send it to the printer.

Share this post


Link to post
Share on other sites

I found this also.  $150 and you're done. 

 

Another trick to consider is to set up a printer in Windows for these reports with their defaults configured for your reports. That way when you print to it, you don't need to change any print parameters. 

 

I see one can generate reports, but I don't see any support for printing from the command line. In that case I'd have CR create the  RPT files as I mentioned in my first post and then open the Report Viewer passing the RPT file in the command parameters with MEP. That way you avoid the whole "File open..."  part. Then just have MEP do a CTRL+P to print. I think the last selected printer is remembered and you can simply click OK on the button control.

Share this post


Link to post
Share on other sites

I forgot to add that if the report viewer doesn't remember the last used printer, you can use MEP to change the default printer to the custom configured one then change it back. 

Share this post


Link to post
Share on other sites

I am testing out the Report Commander, but I can't get it to actually log into our server. Not sure what the issues is and/or if it is related to the fact that I have a trial version.  ???

Share this post


Link to post
Share on other sites

I've not used it. I know there are authentication settings that need to be made. Contact their support. 

Share this post


Link to post
Share on other sites

Ok, so I reached out to their tech support and it appears there is conflict between their app and Jeff-Net. Therefore, the Report Commander is not an option for us. Back to square one: I don't know how to make MEP print something.

Share this post


Link to post
Share on other sites

Text Type Ctrl+P would be my guess, but I haven't printed anything from Crystal in a dozen years or more.

In MEP it's best to use keyboard shortcuts or Windows controls. According to this page, Ctrl+P should start the print process. 

Share this post


Link to post
Share on other sites

I know Ctrl+P invokes the print menu, but unfortunately my requirements aren't that simple. I need a handful of reports to print on a schedule. (5:30A, M-F)

1) Open the report in Crystal (I can get Crystal to open, but I can't get it to point to a specific report)

2) Send the report to a specific printer (I can invoke printing to a default printer, but I can't figure out how to designate a specific printer)

3) Set printer options to 8 copies, single sided, stapled (I have no idea how to access printer properties through MEP)

**for two of the reports, I need to set a date parameter to "today()+120"

 

Share this post


Link to post
Share on other sites

Please read my messages more carefully and think about how they apply to your condition.

 

1) I suggested you open CR report viewer with a parameter for the report you want. Notepad is an example attached of opening a file named test.txt. This is simpler than doing a file-open routine and I would want to try this first. Also if you have a file association for rpt, you can simply put the document name in the program/path name. I.E. if you can double click on the file in Windows and it opens, this will work. Then close the program after printing that report if needed.

2) I explained I would change the default printer with MEP then change it back when done.

3) Create a duplicate of the printer and set all the settings you need as defaults. Doing so only affects that virtual printer. So like LaserJet5500, LaserJer5500-doubleSided, and so forth. You can change printer settings in MEP also, but it's more code and time and more possibility of having a problem. 

 

Are you creating report templates or running reports with the viewer? 

 

2020-08-04_14-22-40.jpg

Share this post


Link to post
Share on other sites
3 hours ago, Boss-Ton said:

Ok, so I reached out to their tech support and it appears there is conflict between their app and Jeff-Net. Therefore, the Report Commander is not an option for us. Back to square one: I don't know how to make MEP print something.

There are many companies that do this sort of thing. You might consider doing a search and checking them out. 

Also have you asked SAP SE or the CR community if there's a way to automate natively with CR?

What about these guys? They show a demo of printing on a schedule. 

Just some additional thoughts. I'm sure you can do it with MEP too. 

Share this post


Link to post
Share on other sites

I don't know how to change a date parameter in CR, but I imagine you open up some dialog box and change a value then close it. I would do this with MEP's Windows Control commands. Click the button, wait for the control to exist, enter a value in the control, send a click to the "OK button" control. Something like that. 

But are you sure you can't save a separate copy report with that 120 day plus value? If you can, that would make things simpler. 

There's a good tutorial of how to use controls in the sample macros I think. It uses Windows Calculator. 

Share this post


Link to post
Share on other sites
On 7/31/2020 at 9:31 PM, Boss-Ton said:

I have a series of Crystal reports I need to send to a specific printer each morning at a designated time (with finishing options such as double sided and stapled). I haven't been able to find options within ME Pro to allow me to do this. Has anyone successfully accomplished a task like this yet? If so, can they share with me the specifics on how to do it?

 

Much appreciated!


Are you already comfortable with writing MEP macros? Or is this your first serious attempt?

 

As you’ve still been unable to achieve your objective after Cory’s very detailed instructions, I suggest you set Crystal Reports aside for a while and instead try to tackle the task as close as possible with Notepad. That’s an application we can access. Show us your macro, including its code, and we can then try to reproduce and/or advise you of any specific issues.

 

You can then apply the same approach to CR.

 

Terry

 

 

Share this post


Link to post
Share on other sites

An excellent suggestion Terry. A common application would make it easy for us to help. 

I could also give better instructions on how to make multiple virtual printers for the same physical printer to facilitate different default settings.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...