Showing posts with label excel. Show all posts
Showing posts with label excel. Show all posts

Friday, March 30, 2012

problem running vb.net application with sqlexpress in system with only .NET FRAMEWORK

Hi,

I have developed a stand alone application that get data from excel and dumps it in local database (sql server database primary data file) in visual studio .net 2005. I had no issues while developing the application. When i am trying to install this application in the standalone system with .net framework 2.0 and no backend database it giving the following error

provider: sql network interfaces, error 26 - Error locating Server/ Instance Specified

connection string i am using is

Dim objLocalDB As System.Data.SqlClient.SqlConnection

objLocalDB = New System.Data.SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=" & System.AppDomain.CurrentDomain.BaseDirectory & "LFDB.mdf;Integrated Security=True;User Instance=True")

I dont want to use any backend database. I only want to use the database that comes with .net (i.e sqlexpress)

Please help me how can i get through this problem.

hi,

Manyam wrote:

When i am trying to install this application in the standalone system with .net framework 2.0 and no backend database it giving the following error

provider: sql network interfaces, error 26 - Error locating Server/ Instance Specified

I can't understand if you installed SQLExpress as well, on the target computer... did you?

regards

|||SQL Server Express is a backend database although the GUI tools are more lightweight than the ones of the more bigger editions. If you want to use user instances as mentioned in the connection string, you will need to have a SQL Server Express Service in place to attach the database to the Service. SQL Server Express can be deployed within your application (even through clickonce deplyoment but at the end need to be installed).

HTH, Jens K. Suessmeyer.

http://www.sqlserver0205.de
|||

Manyam wrote:

I dont want to use any backend database. I only want to use the database that comes with .net (i.e sqlexpress)

Please help me how can i get through this problem.

SQL Express is not part of the .NET Framework, it is a completely separate product that must be installed if you are going to use it. You can add SQL Express as a prerequisite to you application installation automatically using either ClickOnce or standard Setup Projects in VS 2005, in your projects properties, click the Prerequisite button and make sure SQL Express is checked in the list. This will automatically include the SQL Express installer in your deployment and install it on the target computer if it is needed.

Mike

|||

Hi,

Thanks for your suggestion. So we cannot run vb.net application that is developed using sql server management studio without SQL EXPRESS and only .net framework.

I tried to open the link provided by you. Its not opening. I am getting page cannot be displayed.

|||

Hi,

Thanks for your valueable suggestion. So i cannot run a vb application developed using sql server management studio without SQL EXPRESS.I tried installing SQL EXPRESS in standalone system, but its giving issues.

Process followed -->

Uninstalled existing framework.

Installed .NET framework 2.0Dowloaded SQLEXPRESS and istalled in system.

Its throwing a error that .net should require some updates... What updates do we need to install to get this working.

Thanks in advance.

|||What's your OS? If WIndows XP Pro, this needs SP2 and updated security patches

Monday, March 26, 2012

Problem rendering to Excel when using SOAP

I'm using Reporting Services 2005 with VS2005 and getting garbage when setting format=excel. (snippit below) All the other formats work fine and excel works fine if I use URL access with the report manager for the same report.

Any ideas how to troubleshoot this? My SOAP code is as follows:

Dim reportAsByte() =NothingDim rsAs report_engine.ReportExecutionService =New report_engine.ReportExecutionService'credentials

rs.Credentials =

New System.Net.NetworkCredential("zzzzzzz","zzzzzzzzz","zzzzzzzzzzz")

rs.PreAuthenticate =

TrueDim reportpathAsString ="/" & System.Configuration.ConfigurationManager.AppSettings("report_folder") &"/" & report_nameDim zoomAsString ="False"Dim streamRootAsString =NothingDim deviceInfoAsString =NothingSelectCase formatCase"HTML4.0","HTML3.2"

deviceInfo =

"<DeviceInfo>"

deviceInfo &=

"<StreamRoot>" & streamRoot &"</StreamRoot>"

deviceInfo &=

"<Toolbar>False</Toolbar>"

deviceInfo &=

"<Parameters>False</Parameters>"

deviceInfo &=

"<HTMLFragment>True</HTMLFragment>"

deviceInfo &=

"<StyleStream>False</StyleStream>"

deviceInfo &=

"<Section>0</Section>"

deviceInfo &=

"<Zoom>" & zoom &"</Zoom>"

deviceInfo &=

"</DeviceInfo>"CaseElse

deviceInfo =

"<DeviceInfo></DeviceInfo>"EndSelect'variables for the remaining paramtersDim historyIDAsString =NothingDim credentialsAs report_engine.DataSourceCredentials =NothingDim showHideToggleAsString =NothingDim encodingAsStringDim mimeTypeAsStringDim warnings()As report_engine.Warning =NothingDim reportHistoryParameters()As report_engine.ParameterValue =NothingDim streamIDS()AsString =NothingDim execInfoAsNew report_engine.ExecutionInfoDim execHeaderAsNew report_engine.ExecutionHeader

rs.ExecutionHeaderValue = execHeader

execInfo = rs.LoadReport(reportpath, historyID)

Try'execute the report

report = rs.Render(Format, deviceInfo,

"", mimeType,"", warnings, streamIDS)'flush any pending response

Response.Clear()

'set the http headers for a PDF response

HttpContext.Current.Response.ClearHeaders()

HttpContext.Current.Response.ClearContent()

HttpContext.Current.Response.ContentType =

"text/html"'filename is the default filename displayed

HttpContext.Current.Response.AppendHeader(

"Content-Disposition","filename=""" & savefilename &"""")'send the byte array containing the report

HttpContext.Current.Response.BinaryWrite(report)

HttpContext.Current.Response.End()

Catch exAs ExceptionIf ex.Message ="Thread was being aborted."Then

HttpContext.Current.Response.ClearHeaders()

HttpContext.Current.Response.ClearContent()

HttpContext.Current.Response.ContentType =

"text/html"

HttpContext.Current.Response.Write(

"<HTML><body><h1>Error</h1><br>" & ex.Message &"</body></html>")EndIfEndTry

Here's the garbage that is generated:

? ? ?> ? ?????????????????????????????????????? !"#$%&'()*+,-./0123456789:;<=>?@.ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi?????????ot Entry ?? `?# v??Workbook ? ??? ? ? ?? ? ?\p B ? a ?= ? ? ? = ??? X @. ? " ? ? 1 ?? Arial1 ?? Arial1 ?? Arial1 ?? Arial1 ? ? Arial1 @. ? Arial 3 "$"#,##0_);\("$"#,##0\) = "$"#,##0_);[Red]\("$"#,##0\) ? "$"#,##0.00_);\("$"#,##0.00\) I " "$"#,##0.00_);[Red]\("$"#,##0.00\) i*2 _("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@._) W)) _(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@._) y,: _("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@._) g+1 _(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@._) )? [$-1010409]General?? ????? ????? ????? ??????????????????????????????????? (?? +?? )?? ,?? *?? ?? `@.@.?? `@.?? ` @.?? `@.?? `@. @. ?? @.?? `@. @. ?? ` ?? `@. @. ?? `"" ?? `"" ?? `"" ? ? ? `"" ?? ? `"" ? ? `@. ?? `@. @. ? ? ` ?? ? ? ? ? ? ? ? ? ? ??0需 drugs_for_reordering? ? ??8 ? ?? ?? ?R ? 3????;s??? ?F ??3????;s????JFIF HH? (" & #0$&*+-.- "251,5(,-,? , ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,? 0 " ? ? } !1A Qa "q 2? #B??R?$3br? %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz????????????????????????稩????? ? w !1 AQ aq "2? B??#3R??ъ $4? &'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz??????????????????????妧詪???? ??E?? ?{?[??z.?e??? Z????????=?黄a??Y? ??w ??8?Μ ??z?qZ]???&o x??????? г??達??4????? ?a?M'? ы F? zWQ_5x UO x??\G K??仄? ?? ??8z?<?????? Q?fv8 Rk??? ?M?w???%#?o??'°xz?_k??X???B????f?K???d\??? ?Ty??????U Nk??h|*?a?

I solved my own issue. I was setting the headers wrong. Needed to change

HttpContext.Current.Response.ContentType =

"text/html"

to excel

sql

Monday, March 12, 2012

Problem of merged cells in excel format after exporting from SQL Reporting Services 2000

Hi All,

I've faced a difficult problem. After exporting any report from reporting services to excel file format, in excel sheet there are several merged cells appearing in a cell. I'm using SQL Server 2000 & Microsoft Visual Studio .Net 2003.

Can anyone help me out regarding this? Is there any method in reporting services, so that every column will appear into one cell in excel sheet after exporting the report?

Thanks,

Uttam Kr. Dhar

Medi Assist India Pvt. Ltd.

Do you have any report items either above or below the table in your report? If so, that's probably the cause of the merged cells.

The Excel rendering extension will merge cells throughout the worksheet in order to preserve the defined report layout. Most often, this happens when there is a textbox above the table that functions as a header. If the boundary of the textbox ends in the middle of a table cell, cells will need to be merged.

Try to ensure that the left or right edges of the report item line up with table columns in order to minimize cell merging.

For more information, see the "Excel" section of this article:

http://www.microsoft.com/technet/prodtechnol/sql/2005/rsdesign.mspx

-Chris

Problem of "Export to Excel" for "Chart" within "Matrix"

Hi
Please help to fix the following problem.
I design a report using a matrix to show the Sales data. Within the matrix,
I want to use a Bar Chart to show some the data.
Preview and Export to pdf format is ok and does not have any problem.
However, I get the error message "Specified Cast is not Valid" when I try to
export to Excel. How can I fix it, please help!
Thank You
TonyI have The same problem but with a table on report.
Anybody knows what is causing it?
"Tony" wrote:
> Hi
> Please help to fix the following problem.
> I design a report using a matrix to show the Sales data. Within the matrix,
> I want to use a Bar Chart to show some the data.
> Preview and Export to pdf format is ok and does not have any problem.
> However, I get the error message "Specified Cast is not Valid" when I try to
> export to Excel. How can I fix it, please help!
> Thank You
> Tony

Friday, March 9, 2012

Problem looping through excel workbooks(sheets) in a excel file in ssis

Hi i am new to ssis and i am trying to transfer data from excel file with multiple workbooks(tables) to oledb destination......i followed the instructions given in msdn but they r vague and do not help in achieving the result pls help me...

Quote:

Originally Posted by ashwinkpes

Hi i am new to ssis and i am trying to transfer data from excel file with multiple workbooks(tables) to oledb destination......i followed the instructions given in msdn but they r vague and do not help in achieving the result pls help me...


Use a Variable to Set the property of the work sheet($1,$2,etc) and Create the package.

Change that variable to Ursheet 1, sheet 2, sheet 3 while executing it...|||Thanks Buddy(Anil) it worked...[:)]|||

Quote:

Originally Posted by ashwinkpes

Thanks Buddy(Anil) it worked...[:)]


Fine.you can post some alternatives if you have..