Friday, September 25, 2015

To call a webpage or webservice from stored procedure

First of all run following queries with sys admin rights:
sp_configure 'show advanced options', 1
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1
GO
RECONFIGURE;
GO
sp_configure 'show advanced options', 1
GO
RECONFIGURE;

After successful call then run following query:
Declare @Object as Int;
Declare @ResponseText as Varchar(8000);

Exec sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'get',
                 'http://[domain name]/abc.aspx', --Your Web Service Url (invoked)
                 'false'
Exec sp_OAMethod @Object, 'send'
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT

Select @ResponseText

Exec sp_OADestroy @Object

Tuesday, September 22, 2015

Formatting problem with pdf

In telerik export to pdf I faced very different problem with formatting. One of my report on a server and on local end working fine, but on new server it was not working.
On digging to the issue I have found that difference of MS-Office on both server, older one have MS-office 2010 and newer one have another version, then I found that there is absence of font that I set in pdf file. It was Gloucester font.
Later I have installed it separately on windows server, everything works greatly