on 03-25-2011 8:43 AM
Hi all,
I'm using CR bundled for vs2008 and my problem is that I want to set print job name in the windows's print queue when I sent a report to printer. Is there any easy way to do this?
PS: I'm developing winform application.
thanks in advance
Edited by: oluleci on Mar 25, 2011 9:47 AM
Cannot be done in that version of the product from what I can find. In Crystal Reports 2008 and Crystal Reports for VS2010 you should be able to do it by using the inprocess RAS SDK.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created a test project using VS2010 and re-tried to set the name of print job. The code sample that I'm using as follows;
doc.SummaryInfo.ReportTitle = "reportTitle";
doc.PrintToPrinter(1, false, 0, 0);
and the output is like
[http://s2.imagefrog.net/out.php/i152108_repTitle.JPG]
So, I'm able to change the title now but still "Crystal reports" text is there. Is there any way to get rid of that?
I believe the KB [1386475 - How to set printer name and print job title at runtime using Report Application Server SDK for Visual Studio .NET|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333333383336333433373335%7D.do] will help.
E.g.; you have to use the InProc RAS APIs (which are part of CRVS2010). More on InProc RAS:
[Samples|http://www.sdn.sap.com/irj/boc/samples?rid=/webcontent/uuid/80774579-b086-2b10-db91-ed58c4dda375] [original link is broken];
Help FIles:
http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_api_en.zip
http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_dg_en.zip
- Ludek
A co-worker working on another case figured out how to do this using InProc RAS:
rpt.Load(path);
ISCDReportClientDocument rcd = rpt.ReportClientDocument;
PrintReportOptions prnOpts = new PrintReportOptions();
prnOpts.JobTitle = "This Is my report file nameu201D;
prnOpts.PrinterName = "HPFilePrinter";
prnOpts.PaperSize = CrPaperSizeEnum.crPaperSizeDefault;
rcd.PrintOutputController.PrintReport(prnOpts);
rpt.Close();
- Ludek
Hi,
You can try to use the following functionality in the RAS.
var reportDocument = new ReportDocument();
reportDocument.Load(@"C:\Location\report.rpt");
var printReportOptions = new PrintReportOptions { JobTitle = "Name of the print job");
reportDocument.ReportClientDocument.PrintOutputController.PrintReport(printReportOptions);
Hope this will help you. The PrintReportOptions contain some other parameters you could use as well.
Kind Regards,
Pieter Jong
Crystal Advice
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.