cancel
Showing results for 
Search instead for 
Did you mean: 

Print job name issue

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Adam_Stone
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

thanks for your answer. so, I assume there is no way to implement such a feature right?

I've chosen CR for better functionality and supports but I as far as I experienced this CR for VS2008 gave me the most headache.

Adam_Stone
Active Contributor
0 Kudos

Without upgrading to the versions I listed earlier, the only way that I can think of is to first export to a different format and then try to print that through windows apis.

Former Member
0 Kudos

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?

former_member183750
Active Contributor
0 Kudos

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:

http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10b840c0-623f-2b10-03b5-9d1913866...

[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

Former Member
0 Kudos

Thanks Ludek,

But as you might see from the code sample I posted above, this is just what I'm doing already. So, as you might check from my screenshot that "Crystal Report" text still remains there.

Edited by: oluleci on Apr 12, 2011 7:13 AM

former_member183750
Active Contributor
0 Kudos

Yah - apologies for that. Adam pointed that out to me after I did my post. I suspect that is either the way it was designed to work, or it's a bug.

I'll have to create a Technical Escalation for this and find out from Program Management.

- Ludek

former_member183750
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks Ludek,

I tried that and it seems "Crystal Report" text still remains there and I have my text beside it. For instance;

Crystal Report - my print job title

former_member183750
Active Contributor
0 Kudos

Yup. PM tells me; "by design"

- Ludek

Former Member
0 Kudos

Any other possibility for this?

Former Member
0 Kudos

Ludek,

This is not a trial software actually and even if so, my firm would be ready to pay to remove that hardcoded text. How can this be added by design? Would you please ask the PM that ain't there a way to remove that? Even a patch for it?

former_member183750
Active Contributor
0 Kudos

I asked PM. This is not considered a "bug" so the best you can do is add it to the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports] which is monitored by PM.

- Ludek

Former Member
0 Kudos

Thanks Ludek, I've posted the idea there. However, as I checked the other idea list on that page, I don't think PM to regard that.

Answers (1)

Answers (1)

0 Kudos

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

http://www.crystaladvice.com

Former Member
0 Kudos

Thanks Pieter,

Actually this is not different than what we are doing above and the result is the same.

Thanks anyway,