Hi Chris,
No I am not trapping them because I didn't think I needed to since I'm not connecting directly to the db. The dw object has a web service as it's data source. All the connection logic is in the web service.
Below are the three pieces: WCF, .Net assembly, and WPF.
WCF script...
string ls_ret = ''
try
SQLCA.DBMS = "ADO.Net"
SQLCA.LogPass = "xxx"
SQLCA.LogId = "xxx"
SQLCA.AutoCommit = false
SQLCA.DBParm = "Namespace='System.Data.SqlClient',DataSource='xxx',Database='xxx'"
connect ;
datastore lds
lds = create DataStore
lds.DataObject = 'd_grid'
lds.SetTransObject(sqlca)
lds.Retrieve('ACCTAFIL', 'ENG')
disconnect ;
as_structure = lds.Object.Data
catch (Exception ex)
ls_ret = ex.GetMessage()
finally
destroy lds
end try
return ls_ret
.Net assembly script...
DataStore lds
string lsPath, lsAppFolder
System.Guid newGuid
str_ret lstr_ret
try
lds = create DataStore
lds.DataObject = 'd_ws'
lstr_ret.nbr_rows = lds.Retrieve()
lsAppFolder = System.AppDomain.CurrentDomain.BaseDirectory
newGuid = System.Guid.NewGuid()
lsPath = lsAppFolder + newGuid.ToString() + ".pdf"
lds.SaveAs(lsPath, SaveAsType.Pdf!, true )
lstr_ret.path = lsPath
catch (Exception ex)
lstr_ret.error_message = ex.GetMessage()
finally
destroy lds
end try
return lstr_ret
(VS) WPF script...
var nvo = new dotnetassembly1.n_customnonvisual();
var myPath = nvo.of_create_pdf();
stPath.Text = myPath.path;
wb1.Navigate(new Uri(myPath.path));
Structure for WCF result set...
global type s_structure from Structure
string data_value
string display_value
end type
Structure for .Net Assembly call...
global type str_ret from Structure
string path
long nbr_rows
string error_message
end type
Keep in mind it all works fine on my development VM from a PB WPF client. I also get data back from the WCF when I call it using the WCFTestClient from my VS VM. It's like something is missing from the deployment the .Net assembly dw needs for the retrieval.
Thanks,
Mark