Rounding Error While Exporting A Float Value Into CSV
Nov 8, 2007
Hi There,
I am trying to export a SQL table containing Float Fields to a CSV file. Since its a batch process with 200 tables, I am using BCP to automate the process.
The Problem:
All other fields export fine except the fields with 'Float' values. When I open the CSV, few of the float values show a rounding error.
eg. if the value in SQL table is 0.29 the CSV file has the corresponding value as 0.2899999999....
Few float values are exporting fine, but most of them give the recurring '9's at the end - for no reason. I've tried to find the cause why it happens in few places and not in others, I did not see any similarity.
Hi all I have a Float Field in my table with following values:
1.63 7.42 35.71 0.58
every thing is ok BUT when i Select Data from this table in QUERY ANALIZER environment with (Select * from mytable) , Query Analizer shows me the following values:
I can't take full credit for this. I want to share this with Jeff Moden who did the important research for this calculation here.
All I did was just adapting some old code according to the mantissa finding Jeff made and optimized it a little
Some test codeDECLARE@SomeNumber FLOAT, @BinFloat BINARY(8)
SELECT@SomeNumber = -185.6125, @BinFloat = CAST(@SomeNumber AS BINARY(8))
SELECT@SomeNumber AS [Original], CAST(@SomeNumber AS BINARY(8)) AS [Binary], dbo.fnBinaryFloat2Float(CAST(@SomeNumber AS BINARY(8))) AS [Converted], @SomeNumber - dbo.fnBinaryFloat2Float(CAST(@SomeNumber AS BINARY(8))) AS [Error]
And here is the code for the function.CREATE FUNCTION dbo.fnBinaryFloat2Float ( @BinaryFloat BINARY(8) ) RETURNS FLOAT AS BEGIN DECLARE@Part TINYINT, @PartValue TINYINT, @Mask TINYINT, @Mantissa FLOAT, @Exponent SMALLINT, @Bit TINYINT, @Ln2 FLOAT, @BigValue BIGINT
WHILE @Part <= 8 BEGIN SELECT@Part = @Part + 1, @PartValue = CAST(SUBSTRING(@BinaryFloat, @Part, 1) AS TINYINT), @Mask =CASE WHEN @Part = 2 THEN 8 ELSE 128 END
WHILE @Mask > 0 BEGIN IF @PartValue & @Mask > 0 SET @Mantissa = @Mantissa + EXP(-@Bit * @Ln2)
SELECT@Bit = @Bit + 1, @Mask = @Mask / 2 END END
RETURNSIGN(@BigValue) * @Mantissa * POWER(CAST(2 AS FLOAT), @Exponent - 1023) END Thanks again Jeff!
I am using SSRS 2014. I'm using a matrix instead of a tablix because it allows me to have dynamic columns. In the example I'm showing, two of the columns use the sum function to get the total counts per practice. The third column contains percentages so I averaged for the total but the value is inaccurate compared to the value I would get if the divided the the two totals that are sums of the counts. Is there a way for me to specify that I want to divide the total counts numerator divided by the total counts denominator?
Here's an example report output with the percentage column averaged (inaccurate):
PCP       numerator denominator percentage John Smith  66       104 63.46 Tom Jones   4         36   11.11 . . . Jane Doe    1   1     100 Total 708      1005     72.3
So the 72.3 value is from Avg(metricvalue)
I would like to do this instead: % total = 708/1005, which equals 70.5 - a significant difference.
The metricvalue column is what is the value for every number above (Because it's a matrix).
I am using SQL Server 2000, VS 2003 I have Education table in which there is a field CGPA having float data type (null allowed) I retreive the data from SQL server using stroed proc and store it in SqlDataReader dr while reading if CGPA contains 0 then it raises an error that "Specified cast is not valid" other wise it does not raise any error. while (dr.Read()){ Education e = new Education(); e.EducationId = dr.GetInt32(0); e.Country = dr.GetInt32(1); e.InstitutionName = dr.GetString(2); e.Grade = dr.GetString(3); e.CGPA = dr.GetFloat(4); // ERROR HERE e.Percentage = dr.GetFloat(5); e.PassingYear = dr.GetString(6);} where as in Education CGPA is also the float property can any one tell me how to read 0 value of float from SQL server
hello anyone... i got this message "Error converting data type varchar to float" when i was trying to insert values into table using instead of trigger...
below is my table ClimateData
quote:USE [PVMC Database] GO /****** Object: Table [dbo].[ClimateData] Script Date: 03/26/2008 03:04:44 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[ClimateData]( [Climate_application_id] [uniqueidentifier] NOT NULL CONSTRAINT [DF_ClimateData_Climate_application_id] DEFAULT (newid()), [Latitude] [float] NULL, [Longitude] [float] NULL, [Altitude] [varchar](50) COLLATE Latin1_General_CI_AI NULL, [Climate_type] [varchar](100) COLLATE Latin1_General_CI_AI NULL, [PV_application_id] [uniqueidentifier] NULL, CONSTRAINT [PK_ClimateData_1] PRIMARY KEY CLUSTERED ( [Climate_application_id] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY]
GO SET ANSI_PADDING OFF GO USE [PVMC Database] GO ALTER TABLE [dbo].[ClimateData] WITH CHECK ADD CONSTRAINT [FK_ClimateData_Photovoltaic] FOREIGN KEY([PV_application_id]) REFERENCES [dbo].[Photovoltaic] ([PV_application_id]) ON UPDATE CASCADE ON DELETE CASCADE
Below is photovoltaic table
quote:USE [PVMC Database] GO /****** Object: Table [dbo].[Photovoltaic] Script Date: 03/26/2008 03:06:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Photovoltaic]( [PV_application_id] [uniqueidentifier] NOT NULL CONSTRAINT [DF_Photovoltaic_PV_application_id] DEFAULT (newid()), [PV_site] [varchar](50) COLLATE Latin1_General_CI_AI NULL, [PV_state] [varchar](50) COLLATE Latin1_General_CI_AI NULL, [PV_type_of_system] [varchar](50) COLLATE Latin1_General_CI_AI NULL, [PV_nominal_power] [float] NULL, [PV_module] [varchar](150) COLLATE Latin1_General_CI_AI NULL, [PV_mounting] [varchar](50) COLLATE Latin1_General_CI_AI NULL, [PV_building_type] [varchar](50) COLLATE Latin1_General_CI_AI NULL, [PV_topology] [varchar](50) COLLATE Latin1_General_CI_AI NULL, [PV_new_or_retrofit] [varchar](50) COLLATE Latin1_General_CI_AI NULL, [PV_period_of_design] [varchar](50) COLLATE Latin1_General_CI_AI NULL, [PV_period_of_construction] [varchar](50) COLLATE Latin1_General_CI_AI NULL, [PV_commissioning_date] [datetime] NULL CONSTRAINT [DF_Photovoltaic_PV_commissioning_date] DEFAULT (getdate()), [PV_site_photo] [varbinary](max) NULL, [PV_peak_nominal_rating] [float] NULL, [User_application_id] [uniqueidentifier] NULL, [Org_application_id] [uniqueidentifier] NULL, CONSTRAINT [PK_Photovoltaic_1] PRIMARY KEY CLUSTERED ( [PV_application_id] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY]
GO SET ANSI_PADDING OFF GO USE [PVMC Database] GO ALTER TABLE [dbo].[Photovoltaic] WITH CHECK ADD CONSTRAINT [FK_Photovoltaic_OrganizationDetail] FOREIGN KEY([Org_application_id]) REFERENCES [dbo].[OrganizationDetail] ([Org_application_id]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[Photovoltaic] WITH CHECK ADD CONSTRAINT [FK_Photovoltaic_Users] FOREIGN KEY([User_application_id]) REFERENCES [dbo].[Users] ([User_application_id]) ON UPDATE CASCADE ON DELETE CASCADE
Below also my command for instead of trigger
quote:set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go
CREATE trigger [tr_v_PhotovoltaicClimateData] on [dbo].[v_PhotovoltaicClimateData] instead of insert as BEGIN
insert Photovoltaic (PV_site, PV_state, PV_type_of_system, PV_nominal_power, PV_module, PV_mounting) select distinct inserted.PV_site, inserted.PV_state, inserted.PV_type_of_system, inserted.PV_nominal_power, inserted.PV_module, inserted.PV_mounting from inserted left join Photovoltaic on inserted.PV_site = Photovoltaic.PV_site and inserted.PV_state = Photovoltaic.PV_state and inserted.PV_type_of_system = Photovoltaic.PV_type_of_system and inserted.PV_nominal_power = Photovoltaic.PV_nominal_power and inserted.PV_nominal_power = Photovoltaic.PV_module and inserted.PV_nominal_power = Photovoltaic.PV_mounting where Photovoltaic.PV_site IS NULL /*** Exclude Organization Detail already in the table ***/
insert ClimateData (Latitude, Longitude, Altitude, Climate_type, PV_application_id) select distinct inserted.Latitude, inserted.Longitude, inserted.Altitude, inserted.Climate_type, Photovoltaic.PV_application_id from inserted inner join Photovoltaic on inserted.PV_site = Photovoltaic.PV_site left join ClimateData on inserted.Latitude = ClimateData.Latitude and inserted.Longitude = ClimateData.Longitude and inserted.Altitude = ClimateData.Altitude and inserted.Climate_type = ClimateData.Climate_type where ClimateData.Latitude IS NULL /*** Exclude Organization Types already in the table ***/
END -- trigger def
and finally, i hav tried using this command to insert into table v_PhotovoltaicClimateData.. this is the command to insert
Hello everyone... i have some problem with instead of trigger... after insert values into v_PhotovoltaicClimateData, i got this error, Msg 8114, Level 16, State 5, Procedure tr_v_PhotovoltaicClimateData, Line 6 Error converting data type varchar to float.
quote:CREATE VIEW [dbo].[v_PhotovoltaicClimateData] AS SELECT dbo.Photovoltaic.PV_site, dbo.Photovoltaic.PV_state, dbo.Photovoltaic.PV_type_of_system, dbo.Photovoltaic.PV_nominal_power, dbo.Photovoltaic.PV_module, dbo.Photovoltaic.PV_mounting, dbo.ClimateData.Latitude, dbo.ClimateData.Longitude, dbo.ClimateData.Altitude, dbo.ClimateData.Climate_type FROM dbo.ClimateData INNER JOIN dbo.Photovoltaic ON dbo.ClimateData.PV_application_id = dbo.Photovoltaic.PV_application_id
below is my instead of trigger command...
quote:CREATE trigger [tr_v_PhotovoltaicClimateData] on [dbo].[v_PhotovoltaicClimateData] instead of insert as BEGIN
insert Photovoltaic (PV_site, PV_state, PV_type_of_system, PV_nominal_power, PV_module, PV_mounting) select distinct inserted.PV_site, inserted.PV_state, inserted.PV_type_of_system, inserted.PV_nominal_power, inserted.PV_module, inserted.PV_mounting from inserted left join Photovoltaic on inserted.PV_site = Photovoltaic.PV_site and inserted.PV_state = Photovoltaic.PV_state and inserted.PV_type_of_system = Photovoltaic.PV_type_of_system and inserted.PV_nominal_power = Photovoltaic.PV_nominal_power and inserted.PV_nominal_power = Photovoltaic.PV_module and inserted.PV_nominal_power = Photovoltaic.PV_mounting where Photovoltaic.PV_site IS NULL /*** Exclude Photovoltaic already in the table ***/
insert ClimateData (Latitude, Longitude, Altitude, Climate_type, PV_application_id) select distinct inserted.Latitude, inserted.Longitude, inserted.Altitude, inserted.Climate_type, Photovoltaic.PV_application_id from inserted inner join Photovoltaic on inserted.PV_site = Photovoltaic.PV_site left join ClimateData on inserted.Latitude = ClimateData.Latitude and inserted.Longitude = ClimateData.Longitude and inserted.Altitude = ClimateData.Altitude and inserted.Climate_type = ClimateData.Climate_type where ClimateData.Latitude IS NULL /*** Exclude Climate Data already in the table ***/
END -- trigger def
this is my commad insert values using instead of trigger that i've created...
after execute this commad, i got this error.. quote:Msg 8114, Level 16, State 5, Procedure tr_v_PhotovoltaicClimateData, Line 6 Error converting data type varchar to float.
I have created a stored procedure that contain this field (below) inorder to meet certain criteria. But my problem is when I try to runthe stored procedure I encounter an error "Error converting data typevarchar to float".CASE Final WHEN 0 THEN '--' ELSE Final END AS FinalGradeThe Final field is a float data type.Could anyone teach me how to fix this problem?
In the following code I want to compare 2 values: AccessVal and SQLVal. The values are stored as nvarchars, so I'm isolating the numeric values in a subquery. Notice I'm only selecting 1 row. The commented line, where I compare the values, is throwing the error.
SELECT QA_AutoID, AccessVal, SQLVal ,ROUND(ABS(CONVERT(float, AccessVal,1)),0) as AccessFloat ,ROUND(ABS(CONVERT(float, SQLVal,1)),0) as SQLFloat FROM QA WHERE QA_AutoID in ( SELECT TOP 1 QA_AutoID FROM QA WHERE ISNUMERIC(SQLVal) = 1 AND ISNUMERIC(AccessVal) = 1 ) --AND ROUND(ABS(CONVERT(float, AccessVal,1)),0) <> ROUND(ABS(CONVERT(float, SQLVal,1)),0) ORDER BY ROUND(ABS(CONVERT(float, AccessVal,1)),0) DESC ,ROUND(ABS(CONVERT(float, SQLVal,1)),0) DESC
Here is the output with the comparison commented out...
Here's what I get with the comparison line activated:
I've tried converting to numeric, int and bigint instead of float. I've tried CAST instead of CONVERT. Nothing works.
Problem: ColA (Source) Rounding error to PARTY_NO (Destination) I have a field of text of in a flat file that the flat file connection manager Source picks up correctly €œ70000893€? However when it gets the OLE DB Connection Destination the data has changed to 70000896. That€™s before its even Written to the database. The only clue that something is wrong in the middle is the great Data viewer shows the number as 7.000009E+07 Other clues looking at the data it appears there is a rounding error on only the number that dont end in 00 ColA (Source) PARTY_NO (Destination) 71167300 71167296 70329000 70329000 70410000 70410000 Any ideas people? Thanks in advance Dave
I get an error when I export my report to excel. But I do not get this error if I export the report to any other format. The error is:
An error occurred during local report processing. An error occurred during rendering of the report. An error occurred during rendering of the report. Object reference not set to an instance of an object.
I have a report with embedded subreports for different departments. When I render a department with short subreports the report exports to PDF fine, but when I have a department with longer subreports then I get an error when exporting. Here is the tail end of the error message in the log file:
inetinfo!library!334!03/01/2006-16:08:30:: i INFO: Call to RenderNext( '/Budgeting/Department_Spending_Report' ) inetinfo!chunks!334!03/01/2006-16:08:30:: i INFO: ### GetReportChunk('RenderingInfo_PDF', 2), chunk was not found! this=a34ae82e-c4b2-4343-be6b-3989db988405 inetinfo!reportrendering!334!03/01/2006-16:08:32:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown., ; Info: Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. ---> Microsoft.ReportingServices.ReportRendering.ReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.Collections.ArrayList.get_Item(Int32 index) at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemCollection.get_Item(Int32 index) at Microsoft.ReportingServices.Rendering.ImageRenderer.Table.CalculateItemMeasurement(Orientation orientation, Double childrenMaximumDistance, ReAdjustments itemReAdjustment, ItemContext savedContext) at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance) at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance) at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance) at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance) at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance) at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance) at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance) at Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation orientation, Boolean repeatableParent, Boolean canDelete, Double& minimumCoordinate, Double& distance) at Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.ProcessPages(CompositionBase theComposition, Report theReport, Boolean needTotalPages, Int32 startPage, Int32 endPage, Boolean render) at Microsoft.ReportingServices.Rendering.ImageRenderer.PdfReport.RenderReport(Report report, NameValueCollection deviceInfo, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStreamCallback) at Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStream) --- End of inner exception stack trace --- at Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStream) at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderSnapshot(CreateReportChunk createChunkCallback, RenderingContext rc, GetResource getResourceCallback) --- End of inner exception stack trace --- inetinfo!webserver!334!03/01/2006-16:08:32:: e ERROR: Reporting Services error Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. ---> Microsoft.ReportingServices.ReportRendering.ReportRenderingException: Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
I'm running Reporting Services SP2. I've searched other postings and I can't seem to find anyone else with the same issue. I'm able to export to excel with no problem.
I have a report that I need to export to PDF, when I do so and re-open the report, I get a message stating "A Drawing Error Occurred".
Plus when I have a textbox with a large amount of data, it always kicks to a different page, instead of print what it can fit on the previous page and the rest on the next page.
I have some issues regarding subreports placed in table within body of a report. I have a report Edit.rdl(functions as an Edit link) which is called in as a subreport in all Open Issues.rdl(Main Report)
When the same subreport is exported to excel then the following error message is displayed 'Subreports within table/matrix cells are ignored'.I tried to resolve this issue by first placing a list item in the table and then placing the subreport on top of List item but then the error mesage states that 'DataRegions within table/matrix cells are ignored'.
I have a flat file from which I am attempting to import a column that contains either float numbers or " "(single blank).
I get the following Report: quote:
- Executing (Error) Messages * Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "ADR_SH_PER_ADR " returned status value 2 and status text "The value could not be converted because of a potential loss of data.". (SQL Server Import and Export Wizard)
* Error 0xc0209029: Data Flow Task: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "ADR_SH_PER_ADR " (438)" failed because error code 0xC0209084 occurred, and the error row disposition on "output column "ADR_SH_PER_ADR " (438)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure. (SQL Server Import and Export Wizard)
* Error 0xc0202092: Data Flow Task: An error occurred while processing file "F:WorkValMaster_Reference_Databasehs_1.txt" on data row 2. (SQL Server Import and Export Wizard)
* Error 0xc0047038: Data Flow Task: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - hs_1_txt" (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure. (SQL Server Import and Export Wizard)
* Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED. Thread "SourceThread0" has exited with error code 0xC0047038. There may be error messages posted before this with more information on why the thread has exited. (SQL Server Import and Export Wizard)
* Error 0xc0047039: Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED. Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown. There may be error messages posted before this with more information on why the thread was cancelled. (SQL Server Import and Export Wizard)
* Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC0047039. There may be error messages posted before this with more information on why the thread has exited. (SQL Server Import and Export Wizard)
Now, the strange thing is, as soon as I import the same column from an Excel file in which, for simplicity of "text to Excel" transfer I have all the columns defined as "text"(I have 170 columns), the import works just fine. The Excel file is just a straight out import into Excel of the flat file.
The only difference I see between the flat file and the Excel file is that an empty value in the flat file contains a single blank, while an empty "cell" in Excel contains nothing(cursor doesn't go to the right after clicking inside the cell).
By the way, the column in the SQL table is nullable, which is why I thought there should be no issues from an import value containing blanks exclusively.
Using the Import/Export Data Wizard, I'm trying to export a FoxPro 2.5 DOS (as dBase III) table of 15,000 records to SQL Server 2000. I keep getting this error message: Insert Error, Column 32 ('PROG_START',DBTYPE_DBTIMESTAMP), Status 6: Data Overflow. Invalid character value for cast specification.
I have SQL Server create the table each time I run the wizard. The new table allows NULLS in this column and I made sure to overwrite the empty date fields in the FoxPro table with blanks to make sure it would result in NULL. Originally SQL Server tried to put this as SMALL DATETIME, but when I got the message earlier, I changed it to DATETIME.
I have encountered an error when attempt to open a report which is exported to Excel using SSRS2003. It looks like this:
Microsoft Office Excel File Repair Log
Errors were detected in file 'C:Documents and SettingsTocsonEIMy DocumentsRigidReports ptRigidTransactionSummaryReport3.xls' The following is a list of repairs:
Damage to the file was so extensive that repairs were not possible. Excel attempted to recover your formulas and values, but some data may have been lost or corrupted.
At first I thought it was because of the sheer bulk of the report since when I break down a month's report to every 5 days, it would export without error. So I thought that if I can break a whole report into several worksheets using page break, it might work. Unfortunately, although I did succeed in exporting the whole report into several worksheets, I still encounter the same error. Now I have no idea on what the root of the error is. Note that the same report can be exported in other formats and can be opened without error. Except for a case when I tried opening the same report exported in XML using Excel, an error which might be related to the error above occurs which says that there's an invalid unicode character in the xml file.
Any help in determining the root of the problem and a solution to it?
I've pinned it down to a footer cell that uses an expression to determine the TextAlign property. If I do something as simple as ="Right", I get the error. Of course, if I just use Right, there is no problem. So are expressions not supported in footer cell properties or is there possibly some fix for this?
We are not able to export large data in PDF/Excel. We are getting request time out error. We are able to download large data in XML format. Your inputs will be of great help.
I tried to export a report to excel format. I am getting the below error(Array Index out of bounds). The report is around 12 pages. Any thoughts on this?
Server Error in '/Reports' Application.
Index was outside the bounds of the array. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: Index was outside the bounds of the array.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
[Exception: Index was outside the bounds of the array.]
[Exception: An error occurred during rendering of the report.]
I am exporting data to excel with ssis package.In my system it is working fine., but in server it is giving this error.All the connection string for database and excel file path are coming correct in run time with the help of package configeration. one more thing is if we execute directly the package by double clicking in server it is working, but through my application it is giving this error.
An OLE DB error has occurred. Error code: 0x80040E09. The ProcessInput method on component "Excel Destination" (22) failed with error code 0xC0202009. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. Thread "WorkThread0" has exited with error code 0xC0202009.
I am doing a SSIS package that is going to export the value of a table into an excel file.
I have set Run64bitRuntime debugging setting to false to can utilizate this export, here all goes well, but now I tried to go a little more far and I want to execute this package using the ms-dos command dtexec, and it's here where it gives me the error that in a first moment I has solved changing this set to false.
Has anyone any idea of why it is giving me that error?????
I am getting an error: "Damage to the file was so extensive that repairs were not possible. Excel attemted to recover your formulas and values, but some data may have been lost or corrupted." in some instances when exporting toexcel.
The report is no different than any othere report. This report uses rectagles and text boxes to control layout with two tables but it's pretty straight forward. This only happens for this particular report when exported only to Excel. I am using SQL2005 SP1.
I have a report in SSRS 2008 R2 that has multiple subreports, in fact the report uses the same subreport twice with different parameters. Then that subreport also has a subreport, which has a subreport. (It's a complex data scenario with a hierarchy that can go up to three layers deep.)  The report renders fine in report viewer, but when I try to export to PDF I get the following error:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.Reporting.WebForms.ReportServerException: Object reference not set to an instance of an object.
Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[Code] ....
Each subreport renders correctly to PDF, and if I remove either subreport from the main report, it also renders correctly. But the two subreports together on the report cause the error.
Removing the third hierarchy layer (the final one) fixes the issue. Is there a limit to the number of nested subreports when rendering to a pdf?
I need to export some data from sql server 2012 to a excel file(.xlsx). Truncation error happened when executing the exporting task, error happened in conversion from a column of type nvarchar(max) to a column of type LongText. Max length of the source column data is 4303, and documented length limit of LongText, which is a alias of type Memo, is 64,000. why this error happen?
Below is detailed error message:
- Executing (Error)
Messages
Error 0xc02020c5: Data Flow Task 1: Data conversion failed while converting column "extended_info" (59) to column "extended_info" (143). The conversion returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
(SQL Server Import and Export Wizard)
Error 0xc020902a: Data Flow Task 1: The "Data Conversion 0 - 0.Outputs[Data Conversion Output].Columns[extended_info]" failed because truncation occurred, and the truncation row disposition on "Data Conversion 0 - 0.Outputs[Data Conversion Output].Columns[extended_info]" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
I have the following code that retreives the current value of the item price. however it always rounds up. If I manually enter a return value like so:return (decimal)12.47 It returns the correct value, however if I set it with an expression like this:return (decimal)arParam[1].Value;It rounds the number up: How can I get it to not round up when insertign a value based ona expression? public decimal GetCreditPrice(string CustomerSecurityKey) { try { System.Data.SqlClient.SqlParameter prmCrnt; System.Data.SqlClient.SqlParameter[] arParam = new System.Data.SqlClient.SqlParameter[2]; prmCrnt = new System.Data.SqlClient.SqlParameter("@CustomerSecurityKey", SqlDbType.VarChar,25); prmCrnt.Value = CustomerSecurityKey; arParam[0] = prmCrnt; prmCrnt = new System.Data.SqlClient.SqlParameter("@Price", SqlDbType.Decimal); prmCrnt.Direction = ParameterDirection.Output; arParam[1] = prmCrnt; SqlHelper.ExecuteNonQuery(stConnection, CommandType.StoredProcedure, "GetCreditPrice", arParam); return (decimal)arParam[1].Value;
I have the following statement and I want to round the final value(gbkmut.bdr_hfl)two decimal places.
begin UPDATE gbkmut SET gbkmut.bdr_hfl = gbkmut.bdr_hfl - (SELECT SUM(inserted.bdr_hfl) FROM inserted WHERE inserted.freefield3 = 'Rebate') WHERE reknr = ' 1040' end