Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open report with arguments

Status
Not open for further replies.

kramers

Programmer
May 10, 2004
26
0
0
US
I have a report that will fetch from my database all the parts in a particular product and it has an argument say a serial number. I want to print or generate a PDF from this report using the serial number automatically. If I know the serial number, is there any way for me to execute something (preferrably from the command line) to generate a report.

Hypthetical example:

crw32.exe /niftycommand reporta.rpt "Serial=1234" "ReportFor1234.pdf"
or
crw32.exe /niftycommand reporta.rpt "Serial=1234" LPT1:
 
Crystal does not allow for command line execution of reports, at least not recent versions.

You sound very knowledgable about software development, so when you ask technical questions, at least post your software version.

You say that you want to print or generate a PDF, but you don't say from what... I doubt that you have a DOS batch file, so post what you have and what you need.

There are LOTS of solutions, but you need to take the time to state what you have and what you need rather than asking people to guess.

-k
 
Hi,
Actually, synapse, you can still use a URL command to run reports, but I do not think the older Export Type code works..

We provide some managers with a simple ( they are Managers, after all) desktop shortcut to run the one report they care about Like this :
Code:
[URL unfurl="true"]http://CESERVER/viewrpt.cwr?id=29043&apsuser=Guest&promptex-District="2"&promptex-EmpNbr="ALL"&promptex-PriorityCode="ALL"&promptex-MaintShopCode="ALL"&promptex-MaintZone="ALL"&promptex-SystemID="ALL"&promptex-CompRept="N"&promptex-StartDateStr="02/08/2006"&promptex-EndDateStr="02/10/2006"&promptex-HistoryFlag="active"&init=actx[/URL]

Works for non-restricted reports and, since it is only in our IntraNet, security is not a big issue with this type..

We have also developed a 'common' report_viewer.asp page that can be passed parameters from a desktop shortcut and it then runs a report under a coded user/pass combo, so nothing is visible in the URL..We use that for BOEXI and the DHTML viewer - it can be invoked like this example:
Code:
[URL unfurl="true"]http://CeServer/CeViewer/report_viewer.asp?ReportID=1545&NumParams=2&ParamNames='Dist','Ofc'&ParamValues='1';'Main'[/URL]

If desired I can post that page's code...


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Well I've got Crystal 6, 8, and 10 and a SQL 2000 Server.

Actually I was looking to execute it from a batch file, or DOS command prompt, but I think I'm going to have to write a VB App.

Eventually the task is going to have to be encapsulated into a stored procedure so that's another issue and thus why I was looking for a command line solution.

I usually don't give too many details because in my experience people are more willing to help if you don't have a very specific question...go figure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top