DPI Setting When Rendering To PDF Has No Effect On Embedded Images

Apr 7, 2008

A report contains images rendered at 300 DPI. This DPI is fixed, in order to achieve the required quality of the image when printed.

Rendering the report (locally, using LocalReport.Render) as a PDF, with the DPI set to 300 in the DeviceInfo string does not appear to have any effect as the images in the resulting PDF are rendered at 96 DPI.

One solution is to render the report as a TIFF, which does have the desired effect. However, it is a PDF that is required, and converting the TIFF to PDF is problematic in itself. In addition the conversion of the TIFF to a PDF (using PDFCreator) results in a black that is now a blue-black instead of true black.

Any suggestions?

View 4 Replies


ADVERTISEMENT

Either Rendering Tiff Images In SRS Report Viewer Or Converting Tiff To Jpg Or Gif And Then Rendering

Jun 19, 2007

First of all, this is not in reference to using SRS (SQL Reporting Services) to render a report and then use one of the extensions to render the complete report as a pdf, tiff, excel etc. We have an opportunity to render a list of claims and then embed the supporting docs for each of the claims within the report. We don't have an issue referencing jpg and gif images via URLs and then rendering them within the report after the grid information. We do have an issue rendering tiff images within the report.



You can insert an image object into SRS at design time and have it render and you can convert a complete report to a tiff image but I cannot find a way to be able to render a tiff image when running the report. All you get is the red "x".



My question is has anyone encountered the same issue and, if so, what did you do to resolve the issue?



Thank you,



J Z

View 3 Replies View Related

Embedded Or DB Images Not Showing In ReportViewer

May 8, 2007

I have a report which has an embedded image in the heading and an image control that loads images from the database (Image control Data section configured as MIMEType=image/jpg, Source=Database, Value=Fields!Img_Data.Value).



In both cases I can see the embedded heading image and the database images in design mode (VS2005) and through the report manager web pages. When I try to render the report through the ReportViewer web control in my web application, the images do not display (standard missing image red "X" appears).



I have a button on my web form which re-runs the report and exports it to PDF, and when pressed the report is displayed correctly in PDF with all images.



What do I need to do to the ReportViewer web control for it to show embedded and database images? I am using the ReportViewer for 2005.



Please advise of give me some place to look.



Mark

View 5 Replies View Related

Alternating Embedded Images Using Conditional Arguement

Jun 19, 2007

Hello,



Im trying to embedd a picture into my detail table rows to have a dynamic bar graph happening with data from a column called winbacks.



1.So Ive created the embedded 'bar' image

2. Ive inserted the image into the row and under the image properties i have put under the padding

=144 * (1.0 - Fields!Winbacks.Value / Max(Fields!Winbacks.Value, "dataset1")) & "pt"



This part is working....and the image is stretching accordingly to scale.



I would now like to put in a condition to use a different image OR write some text in the row field if the Winback.Value is the highest in the table for that row...ie write ''top gun'' on top off the bar image

Im not sure if you can write text and have the image appearing but this would be ideal...

so Iam instead trying to create an image with the text and when the winback value is the highest use that image ELSE use the normal image.



Can someone please help with how to do this



thanks

View 1 Replies View Related

Missing Embedded Images In Reporting Services

May 24, 2007

We currently have reports for a client running on SQL 2000 RS. The strange thing (problem) is that we can see any embedded image in the Report when we Preview it, and view it on our testing server (SQL 2000), but at the client's site (also running SQL 2000) the images don't appear at all. The same goes for any graphs inside the report as well. This is very puzzling as we cannot find out what the problem is. The other strange thing is that we can see the images on the client's site when running them through Report Manager, but when we go through the application using the Reports, then the images do not appear at all. We have no idea of what's wrong. The app is running on 2003 Server x64, the database is being hosted on another server running 2003 Server, and the report server is running on another server running Windows 2000 Server.

Any help will be much appreciated.

View 2 Replies View Related

Images Embedded In Header Break When Using Interactive Sort.

Sep 11, 2007

Has anyone experienced this? It's very odd. We have images that display fine in our headers but when you click on an interactive sort button, they become a small box with a red x in them. I'm accessing the reports from the reportviewer embedded in a custom application. Within Visual Studio's preview tabe it works fine. Any ideas?

View 4 Replies View Related

SQL Server Setting Has Any Effect On Queries?

Jul 20, 2005

Hello,When I try to run the following query on two different SQL Servers,I get error on one of the server (both has same set of data). I wastrying to get rows for ProductCode='XYZ_Q1'.SELECT ProductName, ProductType, ProductDesc FROM Product WHEREDepartmentID=12 AND ProductType > 2000 AND CAST(SUBSTRING(ProductCode,CHARINDEX('_', ProductCode)+2, 1) AS int)=1Example dataProductCode|ProductName|ProductType|DepartmentID|P roductDescXYZ_T_1|Test1|1000|12|TestXYZ_T_2|Test2|1000|12|TestABC_T_1|Test3|1000|11|TestABC_T_2|Test4|1000||11|TestXYZ_Q1|Test5|1000|12|TestABC_Q1|Test6|1000|11|TestIt's trying to cast all values under 'ProductCode' column instead ofapplying to subset with condition 'DeparmentID=12 AND ProductType >2000 'I solved the problem by equating it to whole string rather thantrying to extract the integer part of it. But I wanted find-out reasonas to why this is happenning.Is there any SQL Server setting that's causing this?Thank you very muchManchaiah

View 1 Replies View Related

SQL Server 2014 :: Images Not Rendering

Aug 31, 2015

I have developed some reports on SQL Server 2014 SSRS including some Data Bars and Sparklines. The solution files are stored on the server which is Windows Server 2012R2. By default this server runs IE11. The development environment is Visual Studio 2012 (had to install this as SQL 2014 did not arrive with BI tools SSDT).Just to let you know the default IE version running across local network is IE9. Apparently this can't be upgraded because of a number of application compatibility problems.

When I debug the report locally the images render fine under IE9, but when I deploy the reports to report server and then run from there I get image icons appearing instead of the images themselves. Now, I can click F12 to view the web options; it shows IE9 (compatibility view) and Document Mode = Quirks. No matter which combination I apply, for example IE9 view & Doc Mode = IE9 Standards, I still cannot render the images correctly.

I have heard that you cannot downgrade Windows Server 2012R2 from IE11 to IE9 as it is released with IE11 as standard.even if running SQL 2012, and is there perhaps a siple workaround that I may have missed?

View 2 Replies View Related

Images Not Rendering When Exporting To HTML Using Reporting Services

Jan 16, 2008

Hi everyone,

Our system is set up using SQL Server 2000 and Reporting Services for SQL Server 2000. Our web application is built with Visual Studio 2003, C# and .Net Framework 1.1 and is a 3-tier application. On both our localhost and development builds of the application, the images that get rendered do show up properly. On our live build, the images do not.

One difference that we found is that on the live build, users do not have file permission access to our middle tier that is running reporting services. After examining the URL of where the image is trying to point to, we see that it is trying to access the middle tier from the front presentation tier.

My question is, is there a way to send a certain parameter into the Render method to have the images stored somewhere else? Any help would be greatly appreaciated. Here is the code we currently have:

ReportingService rs = new ReportingService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

try
{
//Response.Write("Format: " + format);
if (format == "HTML4.0")
{
// Render arguments
byte[] result = null;
string historyID = null;

string devInfo = "<DeviceInfo><HTMLFragment>True</HTMLFragment></DeviceInfo>";
DataSourceCredentials[] credentials = null;
string showHideToggle = "true";
string encoding;
string mimeType;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string[] streamIDs = null;
ParameterValue[] reportParameters = null;
SessionHeader sh = new SessionHeader();

reportParameters = new ParameterValue[5];

reportParameters[0] = new ParameterValue();
reportParameters[0].Name = "par_userID";
reportParameters[0].Value = userID;

reportParameters[1] = new ParameterValue();
reportParameters[1].Name = "par_menuID";
reportParameters[1].Value = menuID;

reportParameters[2] = new ParameterValue();
reportParameters[2].Name = "par_URL";
reportParameters[2].Value = reportURL;

reportParameters[3] = new ParameterValue();
reportParameters[3].Name = "par_startPage";
reportParameters[3].Value = startPage;

reportParameters[4] = new ParameterValue();
reportParameters[4].Name = "par_endPage";
reportParameters[4].Value = endPage;

//Clean up old files
RemoveFiles(ConfigurationSettings.AppSettings["tempFileLocation"]);

result = rs.Render(reportPath,
format,
historyID,
devInfo,
reportParameters,
credentials,
showHideToggle,
out encoding,
out mimeType,
out reportHistoryParameters,
out warnings,
out streamIDs);

// // For each image stream returned by the call to render,
// // render the stream and save it to the application root
// byte[] image;
// string optionalString = null;
// string tempFilePath = ConfigurationSettings.AppSettings["tempFileLocation"].ToString();
//
// foreach (string streamID in streamIDs)
// {
// image = rs.RenderStream(reportPath,
// "HTML4.0",
// streamID,
// null,
// null,
// reportHistoryParameters,
// out optionalString,
// out optionalString);
//
// FileStream stream = File.OpenWrite(tempFilePath + streamID + ".png");
// stream.Write(image, 0, image.Length);
// stream.Close();
// }

// Write the results to the current Web page
string htmlout = Encoding.ASCII.GetString(result);
htmlout = htmlout.Replace("<hr/>", "");

rs.Dispose();
return htmlout;
}

View 1 Replies View Related

How To Insert Images In The Data Type (BLOB - Images)

May 23, 2003

I am having a problem with MMSQL BLOB with VB, Sorry to say I am new in Programming using VB 6 and MSSQL and I have never touch BLOB in my live.

I just wish anyone could give me any ideal, like, white pages, or manual on how do I insert BLOB data (Images) to MSSQL 2000 database using VB 6. I need to know exspecially the VB Code and the SQL Portion if you have a store procedure code for that it will be nice.
:confused:

View 3 Replies View Related

Images With A Data Value Of A URL, I.e. Web Images, Appear In The Designer But Not In The Actual Report.

Feb 9, 2007

The URL address is for example http://backup/pics/19980.jpg

On the report when I right click on an image the URL is http://localhost/reportserver

I do not understand what is going on. Please help.

Many thanks,

Nic

View 1 Replies View Related

Credential Does Not Take Effect

Mar 13, 2008

I have a sqlserve, which service account is 'local system', running in machine A.

A credential ,which associated a windows user U1 in machine A, mapped to a sqlserver login Login1.

A file named 1.txt that only can be accessed by U1 in machine A.

A CLR procedure P1 that would read the 1.txt file.



I encounter a error when i access the 1.txt file through P1 as Login1:

A .NET Framework error occurred during execution of user-defined routine or aggregate "HelloWorld":

System.UnauthorizedAccessException: Access to the path 'E:1.txt' is denied.

System.UnauthorizedAccessException:

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)

at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)

at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)

at System.IO.StreamReader..ctor(String path)

at StoredProcedures.StoredProcedure1(SqlString fileName)

.



I think it need a credential when a sqlserver login access some resource outside the sqlserver, so i add a credential and mapped to the login

any suggestions would be appreciated.
And please correct me if i have any inaccurate concept.


View 9 Replies View Related

HAVING Clause Has No Effect

Nov 12, 2006

I have this stored procedure. I want to run a few simple SQL functions against my tables. In particular I want to take a subset of records (One or Two years worth) and calculate AVG, VAR and STDEV.

It does not work the way I thought it would. I end up with the whole input table in #tempor1 which is about 6 years worth of records.

set ANSI_NULLS ON
set QUOTED_IDENTIFIER OFF

GO
ALTER PROCEDURE [dbo].[findAve1YearDailyClose_MSFT]
AS
BEGIN
SET NOCOUNT ON;
SELECT adjClosed, volume INTO #tempor1 FROM dbo.dailyCl_MSFT
GROUP BY dateTimed, adjClosed, volume
HAVING (dateTimed > DATEADD (year, -1, MAX (dateTimed)))

SELECT AVG (adjClosed) AS "AVGAdjClose1Year",
VAR (adjClosed) AS "VARAdjClose1Year", AVG (volume) AS "AVGVolume1Year",
STDEV (volume) AS "STDEVVolume1Year", COUNT (*) AS "total"
FROM #tempor1
END

Thus if I change the number of years I subtract from the latest date from 1 to 2 I end up with the same result. What is the problem?

Thanks.

View 3 Replies View Related

Trace Effect On Performance

May 23, 2001

When running a trace on a database, how does if affect that databases performance? Does it slow it down at all?

Thanks In Advance,

Chris

View 1 Replies View Related

Any Effect Of SQL Agent On REPLication?

Feb 4, 2004

Hello,

What happens to these REPLication agents if SQL Agent is stopped and started:
Snapshot Agents
Merge Agents
Misc Maintenance Agents

Can the agent be stopped and started with no thought to the status of replication, or should the replication state be modified in some way before any change to the status of the Agent?

(I know REPL depends on agent, so wuestion is, can REPL simply resume or not when agent is re-started.)

Thanks.
MichaelGG

View 2 Replies View Related

Upgrade Windows NT To 200, Effect The SQL 6.5?

Jan 31, 2004

If the server is upgraded to Windows 2000, will SQL 6.5 require to be upgraded to SQL 7 or 2000?

View 1 Replies View Related

Effect On Snapshots While Reindexing

Apr 30, 2007

Does someone know if doing a reindex on a clustered or non-clustered index cause the snapshot file to grow? In other words, is the data that makes up the snapshot copied from the source to the snapshot database? If a normal reindex is done on the underlying database, will it block users from acessing the snapshot? Any help would be appreciated.

View 1 Replies View Related

Same Effect As Cross Join?

Jul 7, 2006

How can I achieve the same effect as a cross join (since the merge operator doesn't have a cross join)?

Situation is this... a flat file has some header and footer information that I need to keep and attach to each row. So for simplicity sake of an example lets just say header has only 1 thing we care about - a row that says DATE=01/01/06.

I take the file and run a split to split into "Date" "Data" and "other" (other has all the throwaway rows in header and footer I don't care about). Then I use a derived column object to get all the columns out of the "Data". Finally I want to add that Date metadata back to every row in the data...

I thought this would be an easy thing to do.. but I can't seem to figure out how to duplicate that Date info into every row.. Hopefully I am overlooking something simple.

Thanks in advance.

View 13 Replies View Related

Effect Of Joins On The Speed

Aug 6, 2007

Hi..

I want to know that when I do something like..

Select Query
Left Join
Select Query 2
Left Join
Select Query 3

How does it work actually?
As in, whether Query 2 & Query 3 will work only on the records retrieved by Query 1 only.
Or, all the select statements retrieves all the records and then the condition is applied to filter out the results.

Also, does the order of the Select statements make any difference on the speed?

Thanks




View 4 Replies View Related

What Kind Of Performance Effect Do Constriants Have.

Dec 7, 2004

We have a database that we have designed so all the data dependances are managed by the front end code. However the company we are writing it for has asked us to add around 50 constraints. I was just a little worried what kind of effect on performance this would have. Cheers Ed

View 1 Replies View Related

OSQL DELETE Using LIKE, With A Cascading Effect

Nov 16, 2006

Edit: Sorry This is OSQL.What I use as my query is:"DELETE FROM timerecord WHERE Actual_Time_In LIKE '11.12.2006%'"The row of Actual_Time_In is formatted with Date and time (MM.DD.YYYY HH:MM:SS) sometimes there are ten records and I'd rather not have to remove them from the table one at a time. However, even though I have a record that is '11.12.2006 22:43:00' my delete doesn't work osql states I have 0 rows affected.This is only MSDE so I don't have anyother way to open the table.Sometimes these records have other records that reference them. Is there anyway to do a cascading delete without it getting to complex?Thanks of all your help, I am just a tech support guy beating his head against a wall..

View 2 Replies View Related

Does JOIN Order Effect Efficiency?

Feb 5, 2007

Hi all,

Does JOIN order effect efficiency?

If I have three large tables to join together should I join the two that I know will cut the number of rows down a lot first and then join the 3rd table or does it make no difference (if I join the first and 3rd - which I know will be a large result set and then join the 2nd).

Thanks in advance,

Chiz.

View 1 Replies View Related

Effect Of Shrink Database Question

May 1, 2008

Hello all, thanks in advance for any advice here.
My question is, what's the effect of the Enterprise Manager > Tasks > Shrink Database function? It seems to reduce the used space on the device. Testing it on some dev machines, I've seem to have gotten back as much as 20g of space. I know it should grow back to that, but the time it took was minimal, and it didn't seem to affect my developers. They tend to add alot and delete alot during testing. What negative effects of running this should I look out for? Will it affect the DB long term? Is is preferable to schedule once a month or so? Is this done on Production DB's?
Thanks for any guidence on the usage of this.

Bob
Not a downstroke, fistpicker

View 6 Replies View Related

The Collapse/toggling Effect In SSRS

May 27, 2008

Hi Guys,

I have created a report where I have Z-Index all set correctly, but I cannot see the desired effect of toggling as can be seen in the AdventureWorks sample of SalesOrder report that gets shipped with SSRS. What am I missing?

View 1 Replies View Related

Effect Of Do Not Recompute Statistics Option

Jul 13, 2007

I'm looking into the automatic recompilation of stored procedures andI have been reading up on the "Do not recompute statistics" option onindexes.Am I correct in concluding that disabling the "Do not recomputestatistics" option for an index, will ensure that no automaticrecompilations will occur as a result of updates to data in thatindex?Am I also correct in understanding that the "Update Statistics" willstill update statistics for the index even if the "Do not recomputestatistics" option is disabled?RegardsBjørn

View 1 Replies View Related

PRINT Only Takes Effect After T-SQL Completion ?

Jul 20, 2005

Hello All,I have a stored procedure which will act like a main/controller scriptwhich will then invoke more stored procedures (~20). Basically, itlooks something like below:-- start scriptcreate procedure ...print 'process started'exec sp_1exec sp_2exec sp_3....print 'process ended'-- end scriptLooking at it, after running that procedure, immediately I would expectthe first PRINT statement to be printed but it won't. It seemedthat the print statements would only display the messages afterthe whole processing completed.What's the reason for this sort of behaviour. If so, then we wouldnot be able to print any progress reporting in our scripts.Please comment.Thanks in advance.

View 4 Replies View Related

Permissions Grants, Denies Don't Take Effect

Sep 11, 2006

Hi,



I'm trying to grant/deny object permissions in a user database using Enterprise Manager and query tool without success (for €˜public€™ role and individual sql logins). I€™m not getting any error messages. Permission changes just don€™t take effect. Although, there are few objects, which already have permissions granted and I'm able to change permissions for these ones.

How can I change the permissions?

View 4 Replies View Related

Why The Report Parameter Dose Not Take Effect?

Nov 6, 2006

Hi, all experts here,

Thank you very much for your kind attention.

I am encountering a problem with reports built on my SQL Server 2005 Reporting Services Server. The reports parameters do not take effect at all? I chose the value from the report parameter list, but the result returned the whole report data. Why is that? And how can I solve this problem? Really need help.

Thanks a lot in advance for any guidance and help.

With best regards,

Yours sincerely,

View 11 Replies View Related

Change SA Password. Any Effect To Replication?

Sep 11, 2006

Dear all,

I have some questions regard subject above. I want to know the impact of replication process after SA pasword been changed.

Example: server1 (hq), server2 (district) & server3 (district).

If server1, SA password been changed, is it server2 & server3 need to change too?

may i know where is it the replication SA password stored? is it replication script refer ID (SA) from Security -> Logins?

I hope someone can help me.. thanks.

View 1 Replies View Related

Does ALTER COLUMN Effect The Data?

Aug 10, 2007

I just want to change the length of 2 fields. They're CHAR and NVARCHAR type. I want to change the length from 50 to 75.

Will doing this effect the data? Will it delete the data in those columns? I just want to make sure before I do anything. The table contains about 2.5 million rows, so I don't want to mess anything up. I'm aware that the script may take a while to run and finish, but I'm only concerned about data integrity.

Here is my example script syntax to show what I'm planning to do:




Code Snippet

alter table credit alter column writeoffreason char(75) not null;




Does it matter what type of data is in the columns? For now, it's only CHAR and NVARCHAR.

I also read somewhere that you can increase length but cannot decrease without repercussions?

Thanks!

View 3 Replies View Related

Allow Blank Value Does Not Effect When Parameter Is Multi Value = Bug!

Jan 3, 2008

I build reports using reporting services 2005 sp2.
I have 3 parameters---> 3 multi value combo box .
However when I tick "allow blank value" within the report parameter
properties for this drop menu, report WILL NOT run without making
selection.(The xml is ok allow blank value set to true)
the reports still require you to enter a value for all parameters in the report when the report can and should be able to be run with no parameter defined.
the trick "default values for all of the params to "=String.Empty"" is not good .


I found this article but i can't find microsoft hotfix for it .

http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=125877


"Thank you for filing the bug. This issue has been fixed for the next CTP.
Posted by Microsoft on 8/11/2005 at 7:00 PM"

Am I missing something obvious here?

View 1 Replies View Related

Effect Of Update Statistics On Database And On An ASP Application

Jun 13, 2001

Hi

I had run a stored procedure in my server that update statistics against all user defined tables in my database (MSSQL 7.0).

Since then I am getting errors in my ASP application where I am reffering to adovbs.inc.

Here is an example of errors I get.

Microsoft VBScript runtime error '800a0411'

Name redefined: 'adOpenForwardOnly'

/Essai/adovbs.inc, line 14



Below is the stored procedure I have run against the database.

Can anybody help tank you guys.



CREATE PROCEDURE update_all_stats
AS
/*
This PROCEDURE will run UPDATE STATISTICS against
ALL user-defined tables within this database.
*/
DECLARE @tablename varchar(30)
DECLARE @tablename_header varchar(75)
DECLARE tnames_cursor CURSOR FOR SELECT name FROM sysobjects
WHERE type = 'U'
OPEN tnames_cursor
FETCH NEXT FROM tnames_cursor INTO @tablename
WHILE (@@fetch_status <> -1)


BEGIN
IF (@@fetch_status <> -2)


BEGIN
SELECT @tablename_header = "Updating " +
RTRIM(UPPER(@tablename))
PRINT @tablename_header
EXEC ("UPDATE STATISTICS " + @tablename )
END
FETCH NEXT FROM tnames_cursor INTO @tablename
END
PRINT " "
PRINT " "
SELECT @tablename_header = "************* NO MORE TABLES" +
" *************"
PRINT @tablename_header
PRINT " "
PRINT "Statistics have been updated FOR ALL tables."
DEALLOCATE tnames_cursor

View 1 Replies View Related

Need To Know Why Two Calculation Methods Result In Different Rounding Effect

Feb 23, 2004

Hi All,

I have a view that does some calculations on data in the database. Note in the two code snippets, that the columns being used in the calculations are all type FLOAT(53).

My confusion stems from the fact that both code snippets should be functionally the same in my "view" (*snicker* I kill me...), but they return different results which I think are related to rounding issues.

The first snippet:

CREATE VIEW dbo.VIEW_Calculate_PortfolioIndex
AS
SELECT PP.PortfolioID AS PortfolioID,
PP.CreateDate AS CreateDate,
(ROUND((PPI.CloseIndex + (PPI.CloseIndex * PP.DailyPerChg / 100.00)), 2) * PP.AvgHighPriceRatio) AS HighIndex,
CASE WHEN PPI.CloseIndex IS NULL
THEN 100.00
ELSE ROUND((PPI.CloseIndex + (PPI.CloseIndex * PP.DailyPerChg / 100.00)), 2)
END AS CloseIndex,
(ROUND((PPI.CloseIndex + (PPI.CloseIndex * PP.DailyPerChg / 100.00)), 2) * PP.AvgLowPriceRatio) AS LowIndex,
PP.Volume as Volume
FROM dbo.PortfolioIndex PPI INNER JOIN
dbo.PortfolioPerformance PP ON
PPI.PortfolioID = PP.PortfolioID AND
PPI.CreateDate = PP.PrevDate
GO

and it's result set:
PortfolioIDCreateDateHighIndexCloseIndexLowIndexVolume
102/20/2004781.11774.17769.53527896
112/20/2004757.97750.36742.93605740
122/20/2004509.92501.72494.854180516
132/20/2004988.23980.65973.58632337
142/20/20041283.261269.571259.37416145


And the second snippet:

CREATE VIEW dbo.VIEW_Calculate_PortfolioIndex
AS
SELECT PP.PortfolioID AS PortfolioID,
PP.CreateDate AS CreateDate,
(CloseIndex * PP.AvgHighPriceRatio) AS HighIndex,
CASE WHEN PPI.CloseIndex IS NULL
THEN 100.00
ELSE ROUND((PPI.CloseIndex + (PPI.CloseIndex * PP.DailyPerChg / 100.00)), 2)
END AS CloseIndex,
(CloseIndex * PP.AvgLowPriceRatio) AS LowIndex,
PP.Volume as Volume
FROM dbo.PortfolioIndex PPI INNER JOIN
dbo.PortfolioPerformance PP ON
PPI.PortfolioID = PP.PortfolioID AND
PPI.CreateDate = PP.PrevDate

which returns a different result set:
PortfolioIDCreateDateHighIndexCloseIndexLowIndexVolume
102/20/2004784.52774.17772.89527896
112/20/2004755.64750.36740.64605740
122/20/2004512.43501.72497.294180516
132/20/2004989.77980.65975.1632337
142/20/20041285.991269.571262.05416145


Specifically, I am concerned with the HighIndex and LowIndex values...since the only modification between the two code snippets is that in the second one, the HighIndex and LowIndex calculations use the column name of CloseIndex (as calculated in the select) in the calcs for those two columns, rather than repeating the code used to calculate the CloseIndex column's value.

I am confused as to why the results of the HighIndex and LowIndex caculations are different in the two selects, when the only change (in my view/expectations) is that one references the CloseIndex column, and the other one just reproduces the calculation itself

*scratching head*

any thoughts? Thanks,
Paul

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved