Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, June 28, 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: GenerateReport problem
Joey Skinner
Posts: 6
 
GenerateReport problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Apr 12 4:57 PM
fiogf49gjkf0d

I am making a call to GenerateReport with the following code.  I've hard-coded the connection string (so you can see it) to just what I got out of the MySlxData.CurrentConnection during a previous attempt.





<pre>            string pluginid;
if (ReportsHelper.GetPluginId("Opportunity:Open Opportunities Summary", out pluginid))
{
WebReportingClass reporting = new WebReportingClass();
IDataService datasvc = MySlx.Data.CurrentConnection;
IUser user = MySlx.Security.CurrentSalesLogixUser;

string tempPath = "C:\\temp\\Reports\\";
string report = reporting.GenerateReport(
"Provider=SLXOLEDB.1ersist Security Info=True;Initial Catalog=mydbname;Data Source=SLXDEV;User ID=adminassword=\"password\";Extended Properties=\"PORT=1706;LOG=ON;CASEINSENSITIVEFIND=ON;AUTOINCBATCHSIZE=1;SVRCERT=12345;ACTIVITYSECURITY=OFF;TIMEZONE=NONE\"",
datasvc.Server,
DatabaseServer.dsMSSQL,
tempPath,
false,
false,
"OPPORTUNITY.OPPORTUNITYID",
user.UserPassword,
pluginid,
"",
"",
"",
"SELECT OPPORTUNITY.OPPORTUNITYID FROM OPPORTUNITY",
"",
user.Id.ToString(),
user.UserName);

ReportDocument doc = new ReportDocument();
report = string.Format("{0}run\\{1}", tempPath, report);
doc.Load(report);

	}


The result is the correct report file is actually retrieved and stored to the C:\temp\Reports folder.  But when it tries to load the report, it throws the following exception:

Exception: System.Runtime.InteropServices.COMException (0x8004020B): There was an unexpected error in TWebReporting.GenerateReport. The call to TWSSLCRReport.CreateReport failed. Logon failed. Details: [Database Vendor Code: -2147217843 ] (ErrorCode: -2147220981; Source: SLXWR.dll; Class: EWebReportingServerError) at Interop.SLXWR.WebReportingClass.GenerateReport(...


Thinking it was the connection string, I did a programmatic test creating an OleDbconnection with the  same connection string and was able to execute a select statement without error.  So I believe the connection string is correct.


I have tried everything I could think of.  Any ideas on what to try next?  I've been beating this up for 2 days.  lease share any ideas.


Thank you

[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: GenerateReport problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 12 4:40 AM
fiogf49gjkf0d

What happens when you try to open the report (in Crystal Reports Professional) from C:\Temp\Reports? Any more telling errors? Sometimes the error provided through the viewer can be misleading I have found.


I havent had to call Crystal Reports programmatically but I would have thought the connection string would be overridden by the username and password passed to it for security reasons. Have you checked these are coming out correctly (by debugging the above method)?


 


Thanks,


Nick

[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: GenerateReport problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 12 4:46 AM
fiogf49gjkf0d

You did write the report using the SLX provider didnt you? I.e. didnt "sysdba." all your tables....

[Reply][Quote]
Joey Skinner
Posts: 6
 
Re: GenerateReport problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 12 9:58 AM
fiogf49gjkf0d

The report in C:/temp/Reports works fine when ran as-is.  So the report is fine.  In fact, it is a standard report.  I haven't even gotten to my custom report yet.  I can run the same report from the Reports area in the web client.  But when executed this way, it gets the "logon failed" error.  


Any other ideas on how to control a Crystal report programmatically from within SLX Web?  I have to be able to programmatically export the resulting PDF and email it.  So just using the javascript API to display it doesn't get me where I need to automate the saving/emailing.

[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: GenerateReport problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 12 10:25 AM
fiogf49gjkf0d

I would rule out it being the username and password being passed to the report (as opposed to the connection string). Try it with a user with no password, also try hardcoding the userid and password in the method call.


If you get the report working, with that path, you can then use the Crystal libraries to export the report (then the .NET mail classes to the send the email).


Are you running the code logged in as admin?


 

[Reply][Quote]
Lori
Posts: 8
 
Re: GenerateReport problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 12 11:44 AM
fiogf49gjkf0d

I sent your post to a developer who suggested, "Looks like they just need to call doc.SetDatabaseLogon(user, pwd) before loading the report."

[Reply][Quote]
Joey Skinner
Posts: 6
 
Re: GenerateReport problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 12 4:36 PM
fiogf49gjkf0d

Thank you.  The SetDatabaseLogon(...) call worked.  One change though, you have to call it after the doc.Load(report) call otherwise you get an exception.


 


I'm not exactly sure why you pass in a username and password with the call along with a connection string that has the username and password embedded and then still have to make this call to set the logon params.  But oh well.  Thanks for the help.


 

[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): 6/28/2025 7:56:11 AM