Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
New Member
Posts: 15
Registered: ‎12-20-2011

Launching a Crystal Report from a detail view

In 7.5.x, I could open a Crystal Report for the current record from a detail view with a little javascript (written from a C# Snippet).  For example:

this.btnPrintOrder.OnClientClick = "if (ShowReport) { ShowReport('Sales OrderSmiley Frustratedales Order', 'SALESORDER', Sage.Data.EntityContextStore.EntityId); } else { alert('ShowReport function not defined.'); }";

 

This worked because of a control included in base.master:

 

Page.Header.Controls.Add(new Sage.SalesLogix.Client.Reports.Helper.ReportsControl());

 

However, in version 8 this control no longer exists and the javascript code no longer works.  So far I have yet to find an equivalent method and I don't see anything included in the base.master that suggests an equivalent.  Does anyone know of one?

Bronze Super Contributor
Posts: 129
Registered: ‎06-09-2009

Re: Launching a Crystal Report from a detail view

Look into Sage.Reporting.Service at the showReport function

found under SupportFiles/jscript/Sage/Reporting/Service.js


Raul A. Chavez
http://raul.chavez.com
http://www.crmbi.com
Bronze Super Contributor
Posts: 129
Registered: ‎06-09-2009

Re: Launching a Crystal Report from a detail view

Oh, and you may need to add it to your Base.Master as I believe it doesn't get loaded by default.
Raul A. Chavez
http://raul.chavez.com
http://www.crmbi.com
New Member
Posts: 15
Registered: ‎12-20-2011

Re: Launching a Crystal Report from a detail view

You're always the one who answers first.  I don't know why I don't just e-mail you before posting.  Thanks, Raul.

New Member
Posts: 15
Registered: ‎12-20-2011

Re: Launching a Crystal Report from a detail view

[ Edited ]

It worked.  I did have to add that script to base.master, and then changed my button javascript to:

 

var rs = Sage.Services.getService('ReportingService');if (rs) {rs.showReportByName('[family:name]');} else {alert('Reporting service not found.');}

 

where [family:name] (no square brackets) is the family and name of the report to launch. The current record determines the table name and id with that function, so that's actually pretty easy.

 

Bronze Super Contributor
Posts: 129
Registered: ‎06-09-2009

Re: Launching a Crystal Report from a detail view

How did you add it? You just need it to add a reference on the "require" section of the Java script that initializes SLX:

require ([
"dojo/_base/html",
.....
"Sage/TaskPane/ActivityTaskPaneActions",
"Sage/Reports/Services"
],
Raul A. Chavez
http://raul.chavez.com
http://www.crmbi.com