Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

infostore.commit(iinfoobjects) does not work (Java)

Status
Not open for further replies.

pheynman

Programmer
Mar 12, 2009
8
0
0
US
Hi,

I can't get my code to commit changes to the InfoStore that I'm making to the reports, namely the report logon information.

Code:
			[purple]if[/purple] (reports != [purple]null[/purple] && reports.size() > 0)
			{
				//load and modify each report in the folder
				[purple]for[/purple] ([purple]int[/purple] i = 0; i < reports.size(); i++)
				{
					IInfoObject object = (IInfoObject) reports.get(i);
					IReport report = (IReport) object;
					IReportLogon reportLogon = (IReportLogon)report.getReportLogons().get(0);
					setLogonProperties(reportLogon, _crystalLoginInfo);
					_infoStore.commit(reports);
				}
			}

Code:
	[purple]private void[/purple] setLogonProperties(IReportLogon _reportLogon, CrystalLoginInfo _crystalLoginInfo) [purple]throws[/purple] SDKException
	{
		[purple]try[/purple]
		{
			_reportLogon.setCustomServerName(_crystalLoginInfo.getCustomServerName());
			_reportLogon.setCustomServerType(1);
			_reportLogon.setCustomDatabaseName("");
			_reportLogon.setCustomUserName(_crystalLoginInfo.getCustomUsername());
			_reportLogon.setCustomPassword(_crystalLoginInfo.getCustomPassword());
			_reportLogon.setOriginalDataSource(false);
			/*
			ISDKSet tablePrefixes =_reportLogon.getReportTablePrefixes();
			IReportTablePrefix tablePrefix = (IReportTablePrefix)tablePrefixes.get(CePropertyID.SI_MAPPED_TABLEPREFIX);
			tablePrefix.setMappedTablePrefix(_crystalLoginInfo.getMappedTablePrefix());
			tablePrefix.setUseMappedTablePrefix(true);
			*/
			_reportLogon.setPromptOnDemandViewing(false);
		}
		[purple]catch[/purple] (SDKException sdkEx)
		{
			[purple]throw[/purple] sdkEx;
		}
		[purple]catch[/purple](UnsupportedOperationException unsupportedEx)
		{
			[purple]throw[/purple] unsupportedEx;		    	
		}
	}

The error that I get when I call the commit method is this:

com.crystaldecisions.sdk.occa.infostore.internal.r: An error occurred at the server :
This feature has not been implemented.

cause:com.seagatesoftware.img.OCA.oca_abuse: IDL:img.seagatesoftware.com/OCA/oca_abuse:3.2
detail:An error occurred at the server :
This feature has not been implemented.

The server supplied the following details: OCA_Abuse exception 7680 at [.\osca_i_impl.cpp : 294] 42501 {}
...Deprecated interface called: commit.


The server is Crystal Reports Server 2008. I understand there are 2 more new commmit methods in the new SDKs that do atomic commits(which I'm not currently using but the old one is usable as well from the examples I've seen including in the SDK). I don't mind changing the code and the JARs - which are quite a few - if I'll have to do that, but I don't want to do that just yet to solve one call which might not have to with the code, since the SDK does not say that the commit method itself is deprecated.

Does anybody have any [other] suggestions?

Thanks.
 
The problem was not code-related so it does work, unmodified.
 
Out of curiosity, what was the problem?

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
After replacing the existing JARs with the ones that came with CR2008, it worked.

So something in there was deprecated.
 
On line IReportTablePrefix tablePrefix = (IReportTablePrefix)tablePrefixes.get(CePropertyID.SI_MAPPED_TABLEPREFIX);

Getting NULL object. I am using CE XI R2.
 
I ended up using something different although I don't know how your logic is (by the way, you can see that that part of my code was commented out because it wasn't working):

Code:
ISDKSet tablePrefixes =_reportLogon.getReportTablePrefixes();

[purple][b]if[/b][/purple] (tablePrefixes != [purple][b]null[/b][/purple] && !tablePrefixes.isEmpty())
{ [green]//Change the mapped table prefix[/green]
			Object[] prefixes = tablePrefixes.toArray();
			IReportTablePrefix tablePrefix = (IReportTablePrefix)prefixes[0];					
			tablePrefix.setMappedTablePrefix(_crystalLoginInfo.getMappedTablePrefix());	
			tablePrefix.setUseMappedTablePrefix([purple][b]true[/b][/purple]);
}

Sorry I didn't get to this post sooner. I haven't checked my notifications of late.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top