XML DataSource, Text Dataset And Image From Database Using Visual Studio 2K5 And SSRS 2K5
Feb 19, 2008
"Short" Story Version:
I have a VS 2005 Web Appplication solution that uses SQL Server Reporting Services 2005. One of the projects is a Report Server Project. In this project I have an RDL file that has:
1.)a non-shared XML DataSource (no credentials),
2.)a DataSet with a Command Type of Text and a Query String that is as follows:
<Query>
<XmlData>
<Root>
<LOAD LOAD_ID_PREFIX="" LOAD_ID="" TRUCK="" DIAGRAM=""/>
</Root>
</XmlData>
</Query>
3.)a field that comes from the Database that is of VarBinary(Max) that is a JPEG Image
What happens is, is that by doing #2 above, at design time I can create tables and hook into my datasets and get the report all designed out the way I want. Then at runtime, I have a Stored Procedure that uses the "FOR XML AUTO" option so that I can represent my results from the database in an XML fashion which will allow me to replace the XML Schema in between the Root tags above (in #2) with my actual data (which still has the same schema). I then save the modified RDL to a database table field and move on to happily ever after......in this case, not. In this case, since an VarBinary is involved, unless I want to get a pointer back for the Diagram Column, I have to use the "FOR XML AUTO, BINARY BASE64" option. This returns an Encoded string to represent the Binary value that was in the Database....and this is the partial source of my angst....read on.
My approach that I described above worked flawlessly in all cases where an image wasn't involved. This report is the only report in the whole system I am working on that will have an image and it is the last one being done, so that's why I didn't run into this earlier.
I have tried all kinds of things at different levels, but the thing that I have tried that seemed to me to have the most potential was to use Embedded Code to take the Encoded ASCII Value and convert into something binary that the SSRS Reporting Engine likes (so my image will show), but I have been unsuccessful thus far. The error message I keep getting now from my Embedded Function is: "Invalid length for a Base-64 char array", which I have not been able to resolve thus far....and I do know that the Binary value in the database is good becuase I can see it in pages in my application otherwise.
This aside, is there anyone out there that knows how to take the value of a VarBinary(Max) field and insert it into the Text (XML) DataSet in the markup of an RDL file....and have it appear correctly when the report is rendered in something like the standard Report Viewer Control (or even when being previewed at design time inside of Visual Studio for that matter)?
Just to be clear, the root of my problem, as I see and understand it, is that I have a VarBinary value in a database that is being converted to a string (ASCII...I am presuming) due to how I am writing my stored procedure and then needs to go back to something else binary that the SSRS Engine will accept so that I can see my Image in the report when I render it.
I am wishful that someone out there understands my problem and has run into this and has a solution......but I am wishful of winning the lottery, too, and that hasn't happened yet...............
Thanks.
View 4 Replies
ADVERTISEMENT
Dec 4, 2007
I am using VS2008 and trying to add an Image to a report (RDLC).
The documentation suggests the properties window for the Image field will have a Source and a Value field.
I cannot see them.
Elswhere, the documentation talks about an Image Wizard.
I cannot find that either.
I have added an Image to the Report's Embedded Images list.
How do I add an image to my RDLC?
View 3 Replies
View Related
Apr 22, 2015
I'll go to a dataset, open up the query designer, add a new parameter, then refresh the fields, but the parameter won't be added as a report parameter. If I go to the dataset properties under the list of parameters, the value in the dropdown will be blank. However, sometimes this will automatically add.
Is this a bug in Visual Studio? How do I get around this?
View 3 Replies
View Related
Feb 5, 2007
Hi
I am new to all SQL Related. I am trying to create a datasource to our old database we used in the company to write reports on the data. when I create a new data source and enter all required info, when testing the connection, i get a reply that I do not have the necessary permissions to use this object, although my account is specified as an administrator? can somebody please explain this to me.
View 1 Replies
View Related
Feb 5, 2007
Hi
I am new to all SQL Related. I am trying to create a datasource to our old database we used in the company to write reports on the data. when I create a new data source and enter all required info, when testing the connection, i get a reply that I do not have the necessary permissions to use this object, although my account is specified as an administrator? can somebody please explain this to me.
View 5 Replies
View Related
Apr 29, 2008
How do you define a JDBC datasource in Microsoft Visual Studio? I am using Microsoft Visual Studio to develop reports for SSRS and would like to connect to DB2 via JDBC. Attempting to use the SQL JDBC install as a example, I don't see how to define the SQL JDBC driver to Visual Studio. The SQL JDBC runtime install is very clear, but I don't see how to use this type of datasource in Visual Studio.
Thanks!
View 1 Replies
View Related
Nov 18, 2007
Hi,
I have visual studio 2005 with the sql server express edition that is installed by default when installing vs2005.
I am used to work from within vs when I want to create and work with databases for my web sites (I dont have visual manager installed).
I would like to enable full text search on a table's column.
Is there an easy way to do that from within vs or is it necessary to install another copy of sql server express with advanced services as well as sql server managment studio express?
How can I know if full text search is enabled?
Thanx in advance!
View 1 Replies
View Related
May 31, 2007
(I asked this question in another forum, but think it may be more of asql question)Hi.I bet this is a 101 question, but i'd appreciate any help!I am in the 'where...' section of the configure data source wizzard .(Visual Studio 2005) Column:(From my table) I select 'UserName' from drop-downOperator: I select '=' from drop-downBUT how do I get the UserName (The user is signed into the app) to pass to the where clause?Is it from the Form? Profile? Session?Ive tried Form.Page.User.Identity.Name.ToString; Form.NamingContainer.Page.User.Identity.Name.ToString; Profile.UserName; NOTHING works. IF I set the default value to a user name (eg joe_user) it retrieves fine, but I need it to retrieve for the currently signed in user. THANKS In advance.... Dan
View 7 Replies
View Related
Mar 7, 2007
When creating a report using reporting Services with a cube as a datasource, visual studio 2005 hangs. I have applied SP1 to visual studio.net 2005 .
This is the query generated by query designer in reporting services. When I try to drag and drop another dimension to slice it by , visual studio hangs.
The fact table has just 10,000 records. Are the number of dimensions used to slice the cube too many? How do I optimize this query?
SELECT NON EMPTY { [Measures].[Avg MT Rate - Speech], [Measures].[Change in Avg MT Rate], [Measures].[Edited Lines Per 1000], [Measures].[Speech Utilization], [Measures].[Time Saved %], [Measures].[Speech Edited for Rev 1], [Measures].[Change in Account Productivity], [Measures].[Hours Saved], [Measures].[Lines Per 1000], [Measures].[Average MT Rate - Total Production], [Measures].[Typed Lines], [Measures].[Productivity Time in hours - Edited Docs],[Measures].[Productivity Time in Hours - Typed Docs],[Measures].[Productivity Time in Hours]} ON COLUMNS, NON EMPTY { ([Dim Customer].[Customer Name].[Customer Name].ALLMEMBERS * [Dim Customer].[Dictator Site Name].[Dictator Site Name].ALLMEMBERS * [Dim Date].[The Month].[The Month].ALLMEMBERS * [Dim Date].[The Year].[The Year].ALLMEMBERS * [Dim MT].[Creator Last Name].[Creator Last Name].ALLMEMBERS * [Dim MT].[Creator First Name].[Creator First Name].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( STRTOMEMBER(@FromDimDateTheYear, CONSTRAINED) : STRTOMEMBER(@ToDimDateTheYear, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOMEMBER(@FromDimDateTheMonth, CONSTRAINED) : STRTOMEMBER(@ToDimDateTheMonth, CONSTRAINED) ) ON COLUMNS FROM [ETL DW])) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
View 1 Replies
View Related
Oct 13, 2006
this may seem like a real newbie question, but I got no clue how to solve this problem. When I was working in Visual Studio 2003, whatever I wanted to fill a dataset with data, I was using a SqlDataAdapter that I created like this adapTest.Fill(dsTest); But now, I cant seem to find the sqldataadapter anywhere, I can just create (on the visual interface of one of my page of my aspx project) dataset, but cant find anywhere a adapter to put an SQL instruction into...maybe theres a new way to do this in Visual Studio 2005 that I dont know about. Im not sure if I was clear enough, but what I want in the end is to be able to use my dataset like that dsTest.Tables.Rows[0]["a column"].ToString()by filling the dataset with data like I was able to do in VS2003. Thanks for taking the time to read this.
View 3 Replies
View Related
Apr 7, 2008
Hi everyone!
I'm using Microsoft Visual Studio 2005 to design reports. Is there any way to use one single image as background for a whole report-page? I only managed to set seperate background images for page header, body and footer, so the only 2 possibilities to solve this problem would be to either
* divide the image into 3 parts so that they fit exactly to the page parts or
* not use any page header and footer.
Is there another possibility that I've missed?
Any help is highly appreciated!
Thanks in advance,
Calad
View 1 Replies
View Related
Aug 24, 2006
I have an off the wall situation that occurs when I try to fill a dataset that has already been filled with data. The issue with the DataSet in and of itself was a mistake I made and is not relevant to this forum.
What would appear to be relevant though, is the fact that after the exception was caught, I could not longer query data from the SQL Express database that was included in my project. In other words, when I tried to view the data in the IDE by selecting "Show Table Data," I received a message telling me that the query was running and eventually it timed out.
To fix the problem in my application, I obviously eliminated the bad code. But to be able to query the database again, I had to physically restart my computer (yes, I probably could have restarted the service, I know).
So my question is, has anyone run into this phenomenon before? If so, is there a way to prevent it other than the obvious, which is to clear the DataTables in my DataSet before filling them?
It's not that big a deal, but it is kind of a pain in the rear to have to restart everything because of a stupid coding mistake on the client side while I'm developing an app.
View 1 Replies
View Related
Apr 29, 2008
Hello,
I know this question has been asked here before, but it was ridiculously answered : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=98764&SiteID=1
I have a text object on my crystal report, to which I programmatically want to assign text in CS. It all works fine, except that if I have html tags in there, the text doesn't get formatted, it just displays the html tags as text as well.
Now in thread linked above, the answer was: right click the text object, and format the text object, hit paragraph text and select text interpretation to HTML. The only problem is, that for a text object, it doesn't have the text interpretation option. It's only an option for a formula field. It says so in the tech support link posted inside the post itself!!!
So if you have any idea how I can do this, please someone help me out. I am new to crystal, and there's not much helpful info on it online. I've searched for this for hours, and no solution.
Thanks
View 3 Replies
View Related
Mar 7, 2008
We're just about to enter the dark world of SSRS.
As I understand it, to author the reports, we need Visual Studio. Some stupid questions then:
1> Does SQL Server 2005 come bundled with Visual Studio 2005, if so, this just represents one user license?
2> We will be needing more than one licesnce, what version of Visual Studio is it?
3> Am I right in thinking that I can just Install VS on a client machine instead of direct on the server, if so, is there any SDKs or the like I need to install so I can author SSRS?
4> Do I need to install SSRS on my machine?
Thanks for your help
Lee
View 4 Replies
View Related
Mar 17, 2007
I have a database in my "App_Data" folder of my visual studio project. I can view it fine in Visual Studio's built-in tools for managing a database attached to a solution. However i recently started playing around with the SQL Server Management Studio Express program. When i attach my database to Management Studio, and try to run my program it crashes. I think it might be a permissions error?!? When i detatch it and reattach it in visual studio it runs fine again. Any suggestions? ThanksJason
View 1 Replies
View Related
May 6, 2008
Hi,
I'm having a struggle with the printing of landscape reports in SSRS.
The reports appear fine when printed from the Visual Studio environment, but when I deploy to a web environment I get 1 or 2 blank pages before reporting continues (i'm using the SSRS printer icon, not the browser printer icon).
I've spent ages looking at margin and printer settings and can't find anything wrong - especially as it works under Visual Studio.
Has anyone experienced problems of this nature and how did you resolve them?
Cheers.
Elracorey
View 4 Replies
View Related
May 13, 2008
I have created a database under management studio and i want it to be connected in visual studio but it failed
the error msgs said that the database can't be connected coz the database with same name exits but that is not true
View 2 Replies
View Related
Sep 1, 2007
Hello, I have a database that has Full Text Search it works great under Management Studio Express. I can use the CONTAINS expression no problem. Now when I try using the same database in Visual Studio 2005 the CONTAINS statement it doesn't return any values and I don't get any error messages. The way I call my database from my web.config file is as follows: <add name="MyDB" connectionString="Data Source=.FULLTEXTSEARCH;Integrated Security=True;AttachDBFilename='D:My DocumentsVisual Studio 2005WebSitesApp_DataMyDataBase.mdf';User Instance=false" providerName="System.Data.SqlClient"/> Why doesn't Full Text Search work when I use it from my web application and it does work under SQL Server Management Studio Express? Please help, Louis
View 2 Replies
View Related
Sep 12, 2007
How do i get the database that i am using in visual studio into my SQL server management studio?
i need to create some scripts to create stored procedures on a live server.
View 1 Replies
View Related
Oct 7, 2015
I'm developing an SSRS report using VS2013 Premium with SSDT - BI v12.0.2430.0. SSRS is hosted on a SQL 2014 instance.The underlying database table has a varchar(max) field which stores text and embedded image data from a third-party application. I can extract this text, save it as an html file and open that in a browser. It renders complete with any embedded image.Meanwhile, the report textbox has its Placeholder Properties, Markup type set to HTML. Yet when I run the report, the text is displayed but any embedded image is not.Is there any approach I can take, perhaps transforming the varchar(max) data to another format in the query for my dataset, that can show the text and any embedded image in my report? Or is it that the TextBox control is limited, not unreasonably, to text only? If so, is there another control I could use, perhaps custom or third-party?
View 7 Replies
View Related
Sep 12, 2007
Hi,
I'm using the SSRS report designer within VS2005 and I have a .rdl report that I have placed a background form as an image background. I then have text placed on top of the form, the problem is that everything is aligned within the report designer layout view but when I go to view the report in report preview the text no longer remains vertically aligned within the background form.
This is very frustrating, and almost makes it impossible to marry up a form with report data. Any help would be appreciated.
View 5 Replies
View Related
Mar 13, 2007
When i click upload image button when my database table has no any row, the selected image is saved(one row saved in table). If i continue and select a different image, i get no error sa if the image has been saved but when i view the images i have been saving, its strange even if i saved 10 records they all contain the first image that i saved. In short only the first image is saved the rest of the rows are just duplicates of the first row. so it basically becomes a table of ten rows but with same data rows(same image). Code is below.
Protected Sub btnupload_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim intLength As Integer
Dim arrContent As Byte()
If FileUpload.PostedFile Is Nothing Then
Lblstatus.Text = "No file specified."
Exit Sub
Else
Dim fileName As String = FileUpload.PostedFile.FileName
Dim ext As String = fileName.Substring(fileName.LastIndexOf("."))
ext = ext.ToLower
Dim imgType = FileUpload.PostedFile.ContentType
If ext = ".jpg" Then
ElseIf ext = ".bmp" Then
ElseIf ext = ".gif" Then
ElseIf ext = "jpg" Then
ElseIf ext = "bmp" Then
ElseIf ext = "gif" Then
Else
Lblstatus.Text = "Only gif, bmp, or jpg format files supported."
Exit Sub
End If
intLength = Convert.ToInt32(FileUpload.PostedFile.InputStream.Length)
ReDim arrContent(intLength)
FileUpload.PostedFile.InputStream.Read(arrContent, 0, intLength)
If Doc2SQLServer(txtTitle.Text.Trim, arrContent, intLength, imgType) = True Then
Lblstatus.Text = "Image uploaded successfully."
Else
Lblstatus.Text = "An error occured while uploading Image... Please try again."
End If
End If
End Sub
Protected Function Doc2SQLServer(ByVal title As String, ByVal Content As Byte(), ByVal Length As Integer, ByVal strType As String) As Boolean
Try
Dim cnn As Data.SqlClient.SqlConnection
Dim cmd As Data.SqlClient.SqlCommand
Dim param As Data.SqlClient.SqlParameter
Dim strSQL As String
strSQL = "Insert Into Images(imgData,imgTitle,imgType,imgLength,incident_id) Values(@content,@title,@type,@length,@incident_id)"
Dim connString As String = "Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|safetydata.mdf;Integrated Security=True;User Instance=True"
cnn = New Data.SqlClient.SqlConnection(connString)
cmd = New Data.SqlClient.SqlCommand(strSQL, cnn)
param = New Data.SqlClient.SqlParameter("@content", Data.SqlDbType.Image)
param.Value = Content
'cmd.Parameters.AddWithValue(param)
cmd.Parameters.AddWithValue("@content", Content)
param = New Data.SqlClient.SqlParameter("@title", Data.SqlDbType.VarChar)
param.Value = title
cmd.Parameters.Add(param)
param = New Data.SqlClient.SqlParameter("@type", Data.SqlDbType.VarChar)
param.Value = strType
cmd.Parameters.Add(param)
param = New Data.SqlClient.SqlParameter("@length", Data.SqlDbType.BigInt)
param.Value = Length
cmd.Parameters.Add(param)
cmd.Parameters.AddWithValue("@incident_id", id.Text)
cnn.Open()
cmd.ExecuteNonQuery()
cnn.Close()
Return True
Catch ex As Exception
Return False
End Try
End Function
View 1 Replies
View Related
Jan 19, 2006
I ask because I'm still looking for the source of interface problems I have in using the SSIS designer.
View 4 Replies
View Related
Jul 5, 2012
I have written a report visual studio. The report has 10 multi-value parameters that pull data from their individual data sets within the reports. When running the report from within Visual Studio it renders fine. There are no errors reported, only a warning related to a pathname I have use to retrieve image data and display on the report.Deployment of the report is error free.When I view the report I briefly get the "Loading" splash window, but then nothing. None of the headers or static text is displayed. The results window is blank.
The report defaults all the parameter values. In trying to debug the issue I have found by reducing the number of parameter values the report will render. Once I have all the values added, the report does nothing.Below is the query being used for the report. The where clause in the query shows the parameters being used and the syntax.We are running on Windows Server 2008 R2 and SQL Server 2008 R2.
Ralph
SELECT RTRIM(a.ITEMNMBR) AS Style, RTRIM(a.ITEMDESC) AS Description, a.ITMSHNAM AS UPC, c.LOCNCODE AS Store, d.LISTPRCE AS ListPrice, a.CURRCOST AS Cost,
a.USCATVLS_1 AS [Main Category], a.USCATVLS_2 AS Market, a.USCATVLS_3 AS [Alternate Retail], a.USCATVLS_4 AS Country, b.ITEMXTRAS_1_Type AS Type,
b.ITEMXTRAS_2_Finish AS Finish, b.ITEMXTRAS_3_SubCategory AS SubCategory, b.ITEMXTRAS_4_Department AS Department,
[code]...
View 7 Replies
View Related
Jan 13, 2007
When I try to create a database that will have fields for a date and a time the only data type option in visual studio is datetime. This stores data as dd/mm/yyyy-00.00.
how can I set it to store either a date dd/mm/yyy or a time 00.00 but not both.
As it is now I cant seem to store a time.
Thanks
jim
View 4 Replies
View Related
Nov 7, 2006
I am working with VS version .0.50727 and .Net froamwork 2.0.50727.
Database under Options is set to SQLEXPRESS. In SQL Server configuration Manager, SQLEXPRESS is running and has all except VIA enabled.
When I try to add a new SQL data base to a project, I recieve the message 'Failed to generate a user instance of SL Server due to a failure in starting the process for the user instance. The connection will close.
Can someone help me with setup between VS and SQL serve?
View 2 Replies
View Related
Apr 17, 2007
Dear All,
I am basically new as far as SQl server 2005 concern.
I want to try out reporting services provided by sql server 2005.
That is make report using sql server 2005 and call that report from web or window application.
Please guide me in doing so or give me some useful link.
Thanks
View 1 Replies
View Related
Aug 4, 2007
I'm using Visual Studio 2005 Standard. I have an .mdf database inside my Visual Studio "Server Explorer" under "Data Connections."
How do I script out this database, including the stored procedures in it? In other words, I want to export a SQL script that will create this database.
I'm very much a newbie when it comes to working with database management. I thought I created this .mdf inside my local install of SQL Server 2005 Express, but maybe I did it somehow inside Visual Studio in the Server Explorer. When I open up SQL Server Management Studio Express I don't see this database. I did locate the .mdf on my local C drive but I haven't been able to get Mgt Studio to open it.
View 2 Replies
View Related
Feb 26, 2008
I have a Visual Basic Windows Project and am connecting to an SQL database. I drop a few of the tables from a DataSet onto a Windows form, and I want to scroll through (using the bindingnavigatror) and subsequently save the data if I decide to make changes to it. However, when I click on the save button it doesn't do anything. From the code, the save button is supposed to run this:
Code:
View 1 Replies
View Related
Mar 26, 2008
I can't connect to a SQL Server 2000 database using Visual Studio 2008. When I try to create a SqlDataSource in Visual Studio the db server isn't in the dialog box. When I manually create a connection string it doesn't connect.
When I go to the server, the db is running and apps that use it work fine. I can ping the server, and I can map a drive to it, but I just can't connect to the database. I tried using servername,port - didn't work.
I open SQL Server 2005 Management Studio and try to connect. In the Connect to Server dialog box, when I go to the Server Name dropdown and browse for my database server on the network, the server is not in the list. I tried entering the server name (and password, etc) but it doesn't connect. A different SQL Server 2000 database server does show up there.
View 3 Replies
View Related
Oct 11, 2006
Cann someone pls tell me how to create a database in visual studio 2005. :o
View 6 Replies
View Related
Jul 29, 2006
I created an SQL database in Visual Studio 2005 Express Edition and would like to edit it in SQL Server Management Studio Express. The only databases listed in the Object Explorer of SQL Server MSE are the system databases (ones that are part of the SQL Server MSE).
If I dig through the directories, I can locate my database under the Visual Studio directory, but I am unable to open it. I get an error message stating, "There is no editor available for [my database]... Make sure the application for the file type (.mdf) is installed."
I'm sure that this is a ridiculously simple rookie mistake that I'm committing somehow, but I'm stumped. Any idea what I'm doing wrong?
View 3 Replies
View Related
Jul 9, 2007
I need to find the name of the user that signed in to the web page. For this, I have a web page with a text box, the program should access a SQL database use, use the userID and return the name. My code (working) does the following:string mySqlQuery = "";
string strCnn = "";SqlDataReader myDataReader = null;
mySqlQuery = "SELECT c_name FROM database WHERE c_user='demo'";
//connect to the databasestrCnn = "Data Source=" + connectionServer + "; Initial Catalog=" + connectionDatabase + "; user id=" + connectionUserID + "; password=" + connectionPassword + "; Integrated Security=false";cnn = new SqlConnection(strCnn);
try
{
cnn.Open();MessageBox.Show("Success Opening the Database");
}
catch
{MessageBox.Show("Problems with the database");
}SqlCommand sqlSelectCommand = new SqlCommand(mySqlQuery, cnn);
tbName.Text = "me";
cnn.Close();
This works, I just need to retrieve the value of c_name. Any help, thanks
View 2 Replies
View Related