Showing posts with label calling. Show all posts
Showing posts with label calling. Show all posts

Thursday, March 22, 2012

Email subscription. Dynamic field of From.

hi,
I have a console application calling reporting service to generate email
subscription. It works but the email from field always show the fix address
in RSReportServer.config. Is there a way I can programmable change the From
field with my code?
Please suggest.
regards,
JoeNo, the from field can not be changed. You can change the Reply-To field.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:50E4BCAD-DD67-494D-8D63-205D8E257BBD@.microsoft.com...
> hi,
> I have a console application calling reporting service to generate email
> subscription. It works but the email from field always show the fix
> address
> in RSReportServer.config. Is there a way I can programmable change the
> From
> field with my code?
> Please suggest.
> regards,
> Joe|||That is correct, the from field cannot be changed programmatically per
request. You can usually use the reply-to header to achieve what you're
looking for.
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:50E4BCAD-DD67-494D-8D63-205D8E257BBD@.microsoft.com...
> hi,
> I have a console application calling reporting service to generate email
> subscription. It works but the email from field always show the fix
> address
> in RSReportServer.config. Is there a way I can programmable change the
> From
> field with my code?
> Please suggest.
> regards,
> Joe|||Thanks for your reply.
Joe
"Lukasz Pawlowski [MSFT]" wrote:
> That is correct, the from field cannot be changed programmatically per
> request. You can usually use the reply-to header to achieve what you're
> looking for.
> -Lukasz
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Joe" <Joe@.discussions.microsoft.com> wrote in message
> news:50E4BCAD-DD67-494D-8D63-205D8E257BBD@.microsoft.com...
> > hi,
> > I have a console application calling reporting service to generate email
> > subscription. It works but the email from field always show the fix
> > address
> > in RSReportServer.config. Is there a way I can programmable change the
> > From
> > field with my code?
> > Please suggest.
> > regards,
> > Joe
>
>sql

Sunday, February 19, 2012

Either/Or/Any query returning erroneous(?) results

I have a query that accepts a parameter CustOwn, which can be 0/1/2
(represents =0/=1/=either 0 or 1)
In theory, by calling the query with CustOwn = 2, it should return the sum
of queries where CustOwn = 0 or CustOwn = 1, however I found I wasnt getting
these anticpated results.
I've created 3 versions of the query to hardcode the query for different
CustOwn values (see below). Apart from the 'and CustOwn = x' line, each
version is identical. Yet they return 17/16/8 records respectively - but the
first query should in theory return the sum of the last two queries. Can any
one suggest why this is the case?
[Apologies for the awful explanation!]
Code Snippet:
/* Both - CustOwn not specified */
Select FA.PartNo, FA.Stock, FOO.OnOrder, (Fa.Stock - FOO.OnOrder)as NumFree,
FA.WIP, (FA.Stock - FOO.OnOrder + FA.WIP) as FreeWIP
from FiltersAvailable FA
inner join (Select PartNo, Count(*) as OnOrder
from
(Select d.PartNo, o.Owned, o.Custorderno,
Case Left(o.custorderno,7)
When 'CustOwn' Then Cast(1 as bit)
Else Cast(0 as bit)
End as CustOwn
from orders o
inner join orderdetail d on d.orderid = o.orderid
where (d.StockMoveOut is null or d.StockMoveOut = '')) as FOO
Where (Owned = 0)
Group By PartNo) FOO on FOO.PartNo = FA.PartNo
order By FA.PartNo
/* CustOwn = 0 */
Select FA.PartNo, FA.Stock, FOO.OnOrder, (Fa.Stock - FOO.OnOrder)as NumFree,
FA.WIP, (FA.Stock - FOO.OnOrder + FA.WIP) as FreeWIP
from FiltersAvailable FA
inner join (Select PartNo, Count(*) as OnOrder
from
(Select d.PartNo, o.Owned, o.Custorderno,
Case Left(o.custorderno,7)
When 'CustOwn' Then Cast(1 as bit)
Else Cast(0 as bit)
End as CustOwn
from orders o
inner join orderdetail d on d.orderid = o.orderid
where (d.StockMoveOut is null or d.StockMoveOut = '')) as FOO
Where (Owned = 0)
and (CustOwn = 0) <===================
Group By PartNo) FOO on FOO.PartNo = FA.PartNo
order By FA.PartNo
/* CustOwn = 1 */
Select FA.PartNo, FA.Stock, FOO.OnOrder, (Fa.Stock - FOO.OnOrder)as NumFree,
FA.WIP, (FA.Stock - FOO.OnOrder + FA.WIP) as FreeWIP
from FiltersAvailable FA
inner join (Select PartNo, Count(*) as OnOrder
from
(Select d.PartNo, o.Owned, o.Custorderno,
Case Left(o.custorderno,7)
When 'CustOwn' Then Cast(1 as bit)
Else Cast(0 as bit)
End as CustOwn
from orders o
inner join orderdetail d on d.orderid = o.orderid
where (d.StockMoveOut is null or d.StockMoveOut = '')) as FOO
Where (Owned = 0)
and (CustOwn = 1) <==================
Group By PartNo) FOO on FOO.PartNo = FA.PartNo
order By FA.PartNo
Thanks
Chris
cjmnews04@.REMOVEMEyahoo.co.uk
[remove the obvious bits]>> Yet they return 17/16/8 records respectively - but the
first query should in theory return the sum of the last two queries. <<
it is sum(OnOrder), not number of rows, that for the
first query should in theory return the sum(OnOrder) of the last two
queries|||Well I'm not surprised nobody has answered by question... lol
I appear to have fixed the problem, but I'm still none the wiser!
I was missing some other criteria out of the inner loop. So when I added
this in, it 'fixed' the results such that I now get was was expected:
(CustOwn = Any) = (CustOwn = 1) + (CustOwn = 0)
I wouldnt have thought this would have made a difference but clearly it
has...
Chris|||Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are. Sample data is also a good idea, along with clear
specifications. It is very hard to debug code when you do not let us
see it.
AND cust_own IN (SIGN(@.flag), SIGN(@.flag-2))
(0, -1)
(1, -1)
(1, 0)
Your code stinks. It is nested too deeply. You have BIT datatypes in
SQL! The availabilty of a filter is a status, not an entity.
StockMoveOut can be empty or NULL and they are given the same meaning.
I am going to guess that Ordes had no infomation that should not have
been in Order Details for this query.