BPM - Crystal Report to PDF

I checked back on some previous posts, and I think I know the answer but just wanted to double check. A supplier is requesting that I upload a PDF copy of our Pack Slip to their FTP site - no problems, I’ve already got code that can upload a file to FTP using C#. I just need to generate the PDF…

Using the below code obtained from a previous post works on a data directive, and pops the report to screen. I know of PREVIEW and PRINT as methods for the AutoAction - is there one called “EXPORT” or “GENERATE” for Crystal?

(I know this will be easier in SSRS, and have already got our pack slip created in SSRS but it needs to be made to look a bit prettier and checked before deployment, and I’d like to get this auto upload working before that)

var service = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.PackingSlipPrintSvcContract>(Db);

var ds = service.GetNewParameters();

service.PackNumDefaults(ref ds);
 
//Set required values in ds 
ds.PackingSlipParam[0].PackNumList = "128581";    
ds.PackingSlipParam[0].AutoAction = "PREVIEW";
ds.PackingSlipParam[0].WorkstationID = "BV-PC-001 MarkDamen";
ds.PackingSlipParam[0].ReportCurrencyCode = "GBP";
ds.PackingSlipParam[0].ReportCultureCode = "en-GB";
   
service.SubmitToAgent(ds, "SystemTaskAgent", 0, 0, "Erp.UIRpt.PackingSlip");

Thanks

Can you submit the report as “PRINT” and set the PrinterSettings string to emulate the following? I’ve honestly never tried this and I’m not sure how much of a correlation there is between the PrintDocument object properties and the PrinterSettings string attributes.

1 Like