Showing posts with label populate. Show all posts
Showing posts with label populate. Show all posts

Thursday, March 22, 2012

ASP Page to run a Report

I am trying to create a report (form) to run from an ASP page with one
single prompt. The ASP pagre would then populate the parameter below
as it passes the data to Report Manager. I am tring to skip the step
of opening IE and go straight to the PDF.
Example
Enter Shipment# [2022222]
[Sumbit] [Quit]
shipnum=variable above
http://rpt-serv/ReportServer?/sales%2fC+of+C&shipnum=2022222&rs:Format=PDF
Does anyone have a sample ASP page they would be willing to share?
Thanks
BobThis may be way more than what you need, but search this newsgroup for my
post on 12/11/07 with the terms "Classic ASP" or Google ""Reporting Service
in Classic ASP" to do exactly what I think you want. Once the PDF is
rendered you can open it in IE, save it, or save it directly as a file on a
server (by taking the stream and writing it).
"Bob" <bob@.ebearings.com> wrote in message
news:fa89138c-aa86-41c8-bdc2-c0fe620972d9@.e4g2000hsg.googlegroups.com...
>I am trying to create a report (form) to run from an ASP page with one
> single prompt. The ASP pagre would then populate the parameter below
> as it passes the data to Report Manager. I am tring to skip the step
> of opening IE and go straight to the PDF.
> Example
> Enter Shipment# [2022222]
> [Sumbit] [Quit]
> shipnum=variable above
> http://rpt-serv/ReportServer?/sales%2fC+of+C&shipnum=2022222&rs:Format=PDF
> Does anyone have a sample ASP page they would be willing to share?
> Thanks
> Bob

Thursday, February 16, 2012

Arithmetic overflow error converting numeric to data type numeric

Guys

I'm getting the above when trying to populate a variable. The values in question are :
@.N = 21
@.SumXY = -1303765191530058.2251000000
@.SumXSumY = -5338556963168643.7875000000

When I run, SELECT (@.N * @.SumXY) - (@.SumXSumY * @.SumXSumY) in QA I get the result OK which is -28500190448996439680147097583285.072256 ie 32 places to left of decimal and 6 to the right
When I try the following ie to populate a variable with that value I get the error -
SELECT R2Top = (@.N * @.SumXY) - (@.SumXSumY * @.SumXSumY)@.R2Top is NUMERIC (38, 10)

Any ideas ??Sorry - did a typo - problem code is
SELECT @.R2Top = (@.N * @.SumXY) - (@.SumXSumY * @.SumXSumY)
not
SELECT R2Top = (@.N * @.SumXY) - (@.SumXSumY * @.SumXSumY)|||Try:
SELECT R2Top = CAST((@.N * @.SumXY) - (@.SumXSumY * @.SumXSumY) as NUMERIC (38, 10))|||Thanks blindman but still same error.

If I change data type of @.R2Top to FLOAT I get no error but aren't there accuracy issues with FLOAT ? I have further calculations to perform in the code and the accuracy is very important|||What are the datatypes for @.N, @.SumXY, and @.SumXSumY?|||OK. Here is your problem. numeric(38, 10) only leaves you 28 digits to the left of the decimal. Your problem requires 32 digits to the left of the decimal.

This code works:declare @.N int
declare @.SumXY decimal(26, 10)
declare @.SumXSumY decimal(26, 10)
declare @.R2Top numeric(38, 6)

set @.N = 21
set @.SumXY = -1303765191530058.2251000000
set @.SumXSumY = -5338556963168643.7875000000

select @.R2Top = (@.N * @.SumXY) - (@.SumXSumY * @.SumXSumY)
select @.R2Top|||Thanks blindman