Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Monday, March 26, 2012

MSRT - Error with Exporting the Reports to Excel Format.

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.]

[Exception: An error occurred during rendering of the report.]
Microsoft.Reporting.WebForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension) +489
Microsoft.Reporting.WebForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension) +924
Microsoft.Reporting.WebForms.ServerReportControlSource.RenderReport(String format, String deviceInfo, NameValueCollection additionalParams, String& mimeType, String& fileExtension) +84
Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +153
Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +75
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Santhosh

Santosh,

Do you get this for all reports or just for one particular report. If it is for one particular report next thing is do you know if it is for a particular field?

|||Im getting just this particular report and in the pre prod the same report is working fine only in production Im having this issue. That too it works fine on one day and breaks on the next day Sad.

Monday, March 19, 2012

msg 4820 Bulk insert error -- "Unknown version of format file"

Hi all,

ISSUE:
====================
In SQL 2005 (sp2) I get the following error when preforming a bulk
insert with an associated xml format file:
"Could not bulk insert. Unknown version of format file"

Question:
====================
I am unsure what they mean by "unknown version". Specifically the
format file in question was created using bcp. Also the entire table
scenario was created from a msdn example.

Any ideas? have you seen this before?

NOTE: i can reproduce this issue outside the example but will refer to
msdn considering it is simple and easily reproducible.

Scenario
====================
I can reproduce this error with the BULK INSERT example discussed on
msdn (example A)
http://msdn2.microsoft.com/en-us/library/ms191234.aspx

TO REPRODUCE:

* In short the table structure is:
Person (Age int, FirstName varchar(20), LastName varchar(30))

* Data File Template:
Age<tab>Firstname<tab>Lastname<return>

* xml file format from bcp (and described on msdn)
<?xml version="1.0"?>
<BCPFORMAT
xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1" xsi:type="CharTerm" TERMINATOR="\t"
MAX_LENGTH="12"/>
<FIELD ID="2" xsi:type="CharTerm" TERMINATOR="\t"
MAX_LENGTH="20" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="3" xsi:type="CharTerm" TERMINATOR="\r\n"
MAX_LENGTH="30"
COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
</RECORD>
<ROW>
<COLUMN SOURCE="1" NAME="age" xsi:type="SQLINT"/>
<COLUMN SOURCE="2" NAME="firstname" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="3" NAME="lastname" xsi:type="SQLVARYCHAR"/>
</ROW>
</BCPFORMAT>

* Here is some the actual sql statement that pulls this all together
BULK INSERT mytestnames
FROM 'C:\datatest\exampledata-c.Dat'
WITH (FORMATFILE = 'C:\datatest\examplefmt.Fmt');

Thanks in advanced for any feedback.

Cheers!

Hi,

plz can you show your XML format file "examplefmt.Fmt".

there must be something like this:

examplefmt.Fmt

...

2 SQLCHAR 0 100 "," 2 firstname SQL_Latin1_General_CP1_CI_AS
...

Monday, March 12, 2012

msg 4820 Bulk insert error -- "Unknown version of format file"

Hi all,

ISSUE:
====================
In SQL 2005 (sp2) I get the following error when preforming a bulk
insert with an associated xml format file:
"Could not bulk insert. Unknown version of format file"

Question:
====================
I am unsure what they mean by "unknown version". Specifically the
format file in question was created using bcp. Also the entire table
scenario was created from a msdn example.

Any ideas? have you seen this before?

NOTE: i can reproduce this issue outside the example but will refer to
msdn considering it is simple and easily reproducible.

Scenario
====================
I can reproduce this error with the BULK INSERT example discussed on
msdn (example A)
http://msdn2.microsoft.com/en-us/library/ms191234.aspx

TO REPRODUCE:

* In short the table structure is:
Person (Age int, FirstName varchar(20), LastName varchar(30))

* Data File Template:
Age<tab>Firstname<tab>Lastname<return>

* xml file format from bcp (and described on msdn)
<?xml version="1.0"?>
<BCPFORMAT
xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1" xsi:type="CharTerm" TERMINATOR="\t"
MAX_LENGTH="12"/>
<FIELD ID="2" xsi:type="CharTerm" TERMINATOR="\t"
MAX_LENGTH="20" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="3" xsi:type="CharTerm" TERMINATOR="\r\n"
MAX_LENGTH="30"
COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
</RECORD>
<ROW>
<COLUMN SOURCE="1" NAME="age" xsi:type="SQLINT"/>
<COLUMN SOURCE="2" NAME="firstname" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="3" NAME="lastname" xsi:type="SQLVARYCHAR"/>
</ROW>
</BCPFORMAT>

* Here is some the actual sql statement that pulls this all together
BULK INSERT mytestnames
FROM 'C:\datatest\exampledata-c.Dat'
WITH (FORMATFILE = 'C:\datatest\examplefmt.Fmt');

Thanks in advanced for any feedback.

Cheers!

Hi,

plz can you show your XML format file "examplefmt.Fmt".

there must be something like this:

examplefmt.Fmt

...

2 SQLCHAR 0 100 "," 2 firstname SQL_Latin1_General_CP1_CI_AS
...

Msg 242 when converting date from string (date in 'YYYY-MM-DD hh:mm:ss.ms' format)

MS SQL Server 2000 SP4 Spanish

It doesn't accept such values into query, although it shows them in this format.

select * from values where Dt > '2006-06-26 00:00:00.000'

returns with Msg 242,...

What am I doing wrong?

You have me baffled, because it seems to convert fine for me; however, try this in case it is a locale issue:

Code Snippet

select convert (datetime, '2006-06-26 00:00:00.000' , 121)
as explicitConversion

/*

explicitConversion
-

2006-06-26 00:00:00.000

*/

|||Explicit conversion works, but I need to get MS SQL Server to accept dates in this format (ODBC) Sad|||

Ok, found problem. My fault.

Actually ODBC format requires {ts 'YYYY-MM-DD hh:mmTongue Tieds'}, not just time string.