Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, February 23, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Opening Crystal report in Web 7.2
Todd Herman
Posts: 52
 
Opening Crystal report in Web 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Jun 08 7:38 AM
Is there a trick or "undocumented" feature that is used to run a crystal report from a button/link on a form in Web 7.2.2? We're trying to simply open a crystal report (and maybe pass a record ID to filter the contents) but can't find the right code to make it work. Any suggestions?

Thanks!
[Reply][Quote]
Stephen Redmond
Posts: 190
 
Re: Opening Crystal report in Web 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Jul 08 3:58 AM
Hi Todd,

Having spent some time working on this, I now have it working successfully.

Analyzing the GetReport.aspx (I was pointed in this direction from a post by Nick Galler on the SalesLogix BP Forum) I could see that the following fields are required on your form before it you can call GetReport.aspx and have it run siccessfully. (This is exactly what ReportManager.aspx does):

usercode - The login name of the user. E.g., loup

pass - The encrypted password for the user. Use reflector to see how SLX gets this in Sage.SalesLogix.Client.Reports

pluginid - The ID from the plugin table for the report. E.g. p6UJ9A0004BT = Support Ticket.

keyfield - The key field for the report. This would be based on the table that is specified in the report plugin settings. It needs to be passed as TABLENAME.FIELDNAME. E.g. TICKET.TICKETID

rsf - Leave blank.

sqlqry - The basic query to return the key fields used for the report. E.g. SELECT TICKET.TICKETID FROM TICKET

wsql - The Where clause to be appended to the query. E.g. (TICKET.TICKETID = ‘tXXXXA000001’)

sortfields - leave blank

sortdirections - leave blank

forcesql - leave blank

ss - Security setting – 0 for HTTP, 1 for HTTPS

reportpath - The path to the Slx Report site’s ASPNETRedirect page – this is configured in Application Architect, Tools – Report Server Configuration. E.g., http://localhost:8766/ slxwebrpt/slxwebreporting.dll/ ASPNETRedirect. Get this from Sage.SalesLogix.Client.Reports.ReportingConfiguration.


My approach is to use the following:

- A generic javascript function to create a new hidden field and add a value to it.

- A javascript function to accept all the parameters above and use the function above to create the fields.

Both these functions are static and I put them in general.js

- Some C# code on the open of the form to generate a javascript function with the dynamic values and then register this as a client script.

- a button on the form to call this generated function.

One "gotcha" is to not try to generate the current ID (ACCOUNTID, TICKETID, etc.) in your generated function - instead, have the function point to a field on the page that has the required ID (add a hidden field in AA if you can't find an appropriate one). The reason being that the C# code only runs when the main view is loading, it doesn't run when a user navigates to a new record and therefore your ID will be out of date.

Once you have this basic approach worked out, then you can apply it very quickly to any view.


Regards,



Stephen
[Reply][Quote]
Stephen Redmond
Posts: 190
 
Re: Opening Crystal report in Web 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Jul 08 9:32 AM
Hi All,

I have been asked by some people to provide more information or source code. Unfortunately, I cannot provide full source code at this time. I can give a little more information, but not too much.

You need to create 2 static javascript functions.

Function 1 (I call mine ReportAddField) takes a field name and a value. It uses getElementById to check if the field already exists. If it doesn't, it creates it using createElement. If it does, it updates the value.

Function 2 (I call mine SetupReportFields) takes all the parameters mentioned in my previous post and writes them into fields using ReportAddFields.

Both of these functions are added to general.js which is in SupportFiles\jscript in the VFS. I use this file because it is loaded by all the main views.

Next, I add a button onto the relevant form, say Account Detail, and set the OnClientClick property of the button to "runReport();". I will make sure (by just looking at the source in IE) that there is one field on the main form that has the correct EntityID. If I can't find one, I can add a new hidden field to the form.

I then add a C# snippet to the Load Actions collection of the form. This snippet will call the relevant Sage.xxx functions so that I can establish the current user (the code for this is well published), get the plugin ID for the report (using a simple OleDb connection, command and datareader), and get the path to the reports URL (if you can't find how to do this, just hard code it into the functions above in general.js). Once I have those values, I can construct the text of a javascript function called "runReport()" which will call my SetupReportFields script. This text can then be attached to the page using RegisterClientScriptBlock.


Hopefully that will help you further down the road.


Regards,



Stephen
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 2/23/2025 5:39:47 PM