Showing posts with label emailing. Show all posts
Showing posts with label emailing. Show all posts

Monday, March 26, 2012

Problems with Scheduled Emailing on Datasources

I'm trying to set up my report server to send reports by email to my
management team in the company but I'm unable to do so. It seems like the
report server is able to send hyperlinks but not any other format. The error
I receive is strangely these,
"Cannot create a connection to data source 'Datawarehouse'"
"Database 'Datawarehouse' does not exist"
This "Datawarehouse" is a Analysis Service datasource. Below is my
connection string
Connection Type = OLE DB
Connection String
Provider=MSOLAP;Client Cache Size=25;Auto Synch Period=10000;Data
Source=AP5184;Initial Catalog=Datawarehouse
I have no problems accessing the reports from the web browser but why is RS
reporting that the datasource cannot be found? Anyone got any idea?
Any advice is appreciated.has anyone got any advice to this problem?
"Nestor" <n3570r@.yahoo.com> wrote in message
news:O1b3Q7bVFHA.1452@.TK2MSFTNGP14.phx.gbl...
> I'm trying to set up my report server to send reports by email to my
> management team in the company but I'm unable to do so. It seems like the
> report server is able to send hyperlinks but not any other format. The
> error I receive is strangely these,
> "Cannot create a connection to data source 'Datawarehouse'"
> "Database 'Datawarehouse' does not exist"
> This "Datawarehouse" is a Analysis Service datasource. Below is my
> connection string
> Connection Type = OLE DB
> Connection String
> Provider=MSOLAP;Client Cache Size=25;Auto Synch Period=10000;Data
> Source=AP5184;Initial Catalog=Datawarehouse
> I have no problems accessing the reports from the web browser but why is
> RS reporting that the datasource cannot be found? Anyone got any idea?
> Any advice is appreciated.
>
>

Monday, March 12, 2012

Problems with insert trigger

HI,

I have this trigger which execute an sp for emailing.
This should happen when a user add a new record, now what happens is that when a user insert a new record it sends an email with the record before.

example.
I added record 100, i get an email with record 99.

the trigger is this
CREATE TRIGGER KRS_email_insert ON dbo.KRS_KRFID
after INSERT
AS

SET NOCOUNT ON

DECLARE @.From varchar(100)
DECLARE @.To varchar(100)
DECLARE @.Subject varchar(100)
DECLARE @.Body varchar(4000)

SELECT @.From = 'Klachtenregistratiesysteem',
@.To = i.email,
@.Subject ='nieuwe melding onder volgnummer '+ cast(i.volgnummer as varchar),
@.Body = '<style type="text/css">
<!--
.style1 {color: #FF0000}
body {
background-color: #FFFFFF;
}
-->
</style>
<p>
<table width="*" border="0">
<tr>
<td colspan="2">Geachte '+M.NAAM+',<br>U heeft een klachtregistratieformulier ingevuld bij het Klachtenregistratiesysteem, uw klacht is in het systeem opgeslagen onder volgnummer: <span class="style1">'+ cast(i.volgnummer as varchar)+'<br><br><br></span>
klik <a href="http://links.10026.com/?link=http://web01/Support/KRS_KRFID/ShowKRS_KRFIDRecord2.aspx?KRS_KRFID='+ cast(i.volgnummer as varchar)+'">hier</a> voor meer details<br><br></td>
</tr>
<tr>
<td width="*" bgcolor="#CCCCCC"><div align="right">Onderwerp:</div></td>
<td width="*" bgcolor="#FFFFCC"><div align="left">'+i.onderwerp +'</div></td>
</tr>
<tr>
<td width="*" bgcolor="#CCCCCC"><div align="right">Probleemomschrijving:</div></td>
<td width="*" bgcolor="#FFFFCC"><div align="left">'+i.probleemomschrijving +'</div></td>
</tr>
<tr>
<td width="*" bgcolor="#CCCCCC"><div align="right">Melddatum:</div></td>
<td width="*" bgcolor="#FFFFCC"><div align="left">'+cast(i.melddatum as varchar) +'</div></td>
</tr>
<tr>
<td width="*" bgcolor="#CCCCCC"><div align="right">Evaluatiedatum:</div></td>
<td width="*" bgcolor="#FFFFCC"><div align="left">'+cast(i.evaluatiedatum as varchar) +'</div></td>
</tr>
<tr>
<td width="*" bgcolor="#CCCCCC"><div align="right"></div></td>
<td width="*" bgcolor="#FFFFCC"><div align="left"></div></td>
</tr>
<tr>
<td colspan="2"><div align="right"><br><br><br></div> <div align="left">LET OP: Deze e-mail is verzonden door een automatische mailbox, vragen die u naar deze mailbox stuurt worden niet beantwoord. <br>
Voor vragen of opmerkingen kunt u terecht bij het Editor, telefoon: -1793 of via email: <a href="http://links.10026.com/?link=mailto:Test@.test.com?subject=Vragen en/of info over CompanyKlachtenregistratiesysteem">Test@.test.com</a>. </div></td>
</tr>
</table>
<p> </p>'
FROM KRS_KRFID i, MAN_MEDEWERKERS m
WHERE MELDDATUM < GETDATE()and m.uid = i.melder
EXEC sp_send_cdosysmail @.From, @.To, @.Subject, @.Body

SET NOCOUNT OFF



Can someone tell me what is wrong here!!
Cheers WimI guess you should use 'inserted' virtual table to see which record was inserted into the table and base your mail on that. Check 'inserted', 'deleted' virtual tables in SQL Server documentation on triggers. mojza|||Hi Mojza,

I tried that but i doesn't send anything.
Have to find a workaround!