Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Sunday, March 25, 2012

Changing chart type at run-time

Hello,

I'm coding a web application using ASP.NET 2.0 and I'd like to show users some charts allowing them to chose the chart type at run-time.
I'm building a rdlc (local) report source at run-time starting from a template and working in memory.
Users can select wich rows and columns from a table to display in the chart. They can also chose che chart type (Bar, line, pie etc.)

Now the code works fine the first time it's run. Then the report viewer keeps showing the chart with the same chart type and columns data. Only rows change accordingly to the user selection.

I'm using the following code to initialize the reportviewer:

Dim str As System.IO.MemoryStream = New MemoryStream
rptDoc.Save(str) //->that's the xml doc being saved to a memory stream
str.Position = 0
repView.LocalReport.ReportPath = String.Empty 'Just in case...
repView.LocalReport.LoadReportDefinition(str)
repView.LocalReport.DataSources.Clear() 'Just in case again...
repView.LocalReport.DataSources.Add(New ReportDataSource("DataSet1_01E01000", dt2))
repView.LocalReport.Refresh()

Any suggestion?

Thank you all.Can you share with me how you change the Chart Type at Runtime? Thanks!|||

Sorry for the late reply, I haven't checked forums lately.

As I said I'm building the rdlc (local) report source file at run-time starting from some templates.

The rdlc files are nothing more that XML files and the chart type is defined inside a node. All I do is put the desired type in the right node.

You can also build a rdlc right from scratch and pass it to the ReportViewer component via its LoadReportDefinition method using the overloaded version that gets a IO.Stream as source.

Ask me if you need a sample.

Bye.

|||

You need to reset the report by doing a

ReportViewer1.Reset();//Then setting the datasource and all the properties.
|||

Hello Stojilcoviz,

Can you share with me the sample of your code which changes the chart types at run-time in the RDLC? Thanks.

Changing BLL parameter

I have inherited a web site from another developer. I am new to .net programming. Anyway I have had to add a parameter to an sql procedure and I thought i had made the change in the business logic layer correctly. I am using gridview to display and export to an excel spreadsheet. After my changes my page lets me select my parameters, but now my page come up blank, no error messages the only thing on the page are the save and export buttons.

Please help what have i missed.

Steve

You should provide more details, probably give some code excerpts for others to make suggestions.sql

Thursday, March 22, 2012

Changing access db to sql db web application.

I am experiencing problems with databases for the web application that i am developing. The problem is that I have transferred the database from access to sql which initially seemed to work ok. I am now however struggling to solve the problems with one of my fields titled 'notes'. The trouble is that in the original database the notes field contained different notes from different dates for each record, and each note is separated by carriage returns. It is the carriage returns that are now proving to be a problem in the sql database but i am not sure what to do. Any advice would be appreciated.
Thanks
Dan
You can use Word through OLE to store the notes in Access then import the Word file into SQL Server Image column. Hope this helps.|||sorry am not too sure how i would go about using word, what is ole?|||OLE is Object linking and embedding it allows one office application to import files to another by dragging and dropping. Try the link below to get started. Hope this helps.
http://office.microsoft.com/en-us/assistance/HA011472041033.aspx#WhyOLE

Thursday, March 8, 2012

Change the username in Active Directory

We use extended properties of Active Directory to filter the data in reporting services throw a web services. We send the userid (User!UserId) to the webservices and retrieve some information about the user.
But if we change the name of one user (rename not recreate), he lost all this properties. When try to execute a report show an error:
  • Parameter validation failed. It is not possible to provide valid values for all parameters. (rsParameterError) I know this issue is in the border of reporting services, but we have spent a lot of time without results and we need any help.

    Thanks in advance

    How are you doing your rename? Because that's where your issue is <s>.

    If you're doing it through some GUI interface and that interface doesn't transfer your extended properties on a rename, then that interface has a bug in it <sigh>.

    I do some AD coding but don't have an example I can throw in here. Basically, when any consumer queries AD for a user object, it is allowed to say what properties it's interested in retrieving. If it doesn't know about yours and doesn't retrieve them, it probably doesn't clone them along with the rest of the object. (I think, under the covers, a rename likely does a clone-and-delete.)

    So you have to write something that does know about your extended properties and write a better rename...

    >L<

    |||We rename the user in Active directory but i supposed that in some part of reporting services store the previous username, guid or something to refers to the old user. When we use the user!userID functions, reporting services get the old value instead the new value.

    Our process is:
    We have two parameters, one with the user and other with the information to retrieve and send to another queries. Send this two parameters to the web services and retrieve a parameter (a custom property defined in AD) to send in another query.

    We use directly in web browser the reporting services. And it is the default configuration of report server web.

    Thanks for your patience

    |||

    >>We rename the user in Active directory

    I know that's what you did. I asked you *how* you did this (through what interface).

    But, yes, if you're getting the old version when you look at user!userID, it doesn't matter.

    I don't see why the report server would be caching the previous user name etc, unless you have put this information in as the credentials of the user to run the report in the report configuration?

    Could this possibly be an AD refresh type of problem, instead? IOW, you do the rename and all the domain servers don't know about it?

    >L<

  • Sunday, February 19, 2012

    Change script from MSAccess to SQL access.

    I'm using this script I found on the web. After some tweaking here and there, it works great. I'd like to change it to pull data from a SQL source instead of Access. Anyone know how to do this, give me some pointers?

    Here is the script
    *****************************************************************************************************************

    <%@. LANGUAGE="VBSCRIPT" %>
    <% Option Explicit %>
    <%
    Dim DATA_PATH, Conn, DataRecords, email, user, pass, sendmail
    'Maps to database. Change to your database path.
    DATA_PATH=Server.Mappath("membersdb.mdb")
    ' Create and intiate data connection
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.ConnectionTimeout = 15
    Conn.CommandTimeout = 30
    Conn.Open "DBQ=" & DATA_PATH & ";Driver={Microsoft Access Driver (*.mdb)}; DriverId=25;MaxBufferSize=8192;Threads=20;", "admin", "password"
    Set DataRecords = Server.CreateObject("ADODB.Recordset")
    email=request.form("email")
    'The magic query to look for registered members in the database
    DataRecords.Open "SELECT * FROM MEMBERS WHERE email = '" & email & "'", Conn, 0, 1
    %>
    <%
    'checks if email address exists in the database before sending a message.
    if DataRecords.EOF then
    %>
    We could not find <%=email%> in our database.
    <% Else %>
    <%
    'sets variables
    email = request.form("email")
    'chooses username and password from database that correspond to submitted email address.
    user = DataRecords.Fields("usernames")
    pass = DataRecords.Fields("password")
    Set sendmail = Server.CreateObject("CDONTS.NewMail")
    'put the webmaster address here
    sendmail.From = "Someone@.somewhere.com"
    'The mail is sent to the address entered in the previous page.
    sendmail.To = email
    'Enter the subject of your mail here
    sendmail.Subject = "Membership Login Information"
    'This is the content of thr message.
    sendmail.Body = "Per your request your account login information is: " & vbCrlf & vbCrlf _
    & "Username=" & user & vbCrlf _
    & "Password=" & pass & vbCrlf
    'this sets mail priority.... 0=low 1=normal 2=high
    'sendmail.Importance = 3 commented out causes a error for a call or procedure (line 41)
    sendmail.Send
    %>
    We just sent your login information to <%=email%>.
    You should receive it shortly.
    <%
    ' Close Data Access Objects and free connection variables
    Conn.Close
    Set DataRecords = Nothing
    Set Conn = Nothing
    Set sendmail = Nothing
    %><%end if%>

    ***************************************************************************************************************
    And here's my SQL connection stuff
    Private Sub Class_Initialize()
    ConnectionString = "Provider=SQLNCLI.1;Persist Security Info=False;User ID=sa;Initial Catalog=ABC;Data Source=xx.xx.xx.xx"
    User = "usr"
    Password = "pswrd"
    Set Converter = New clsConverter
    Converter.DateFormat = Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss")
    Converter.BooleanFormat = Array(1, 0, Empty)
    Set objConnection = Server.CreateObject("ADODB.Connection")
    Database = "MSSQLServer"
    Set Errors = New clsErrors
    End Sub
    ****************************************************************************************************************

    sure would appreciate some help!

    You can use a different driver in the connection string. Connectionstrings can be found here: www.connectionstrings.com

    HTH, Jens K. Suessmeyer.

    http://www.sqlserver2005.de

    |||

    As Jens suggested you should be able to simply replace

    Conn.Open "DBQ=" & DATA_PATH & ";Driver={Microsoft Access Driver (*.mdb)}; DriverId=25;MaxBufferSize=8192;Threads=20;", "admin", "password"

    with

    Conn.Open "Provider=SQLNCLI.1;Persist Security Info=False;User ID=sa;Initial Catalog=ABC;Data Source=xx.xx.xx.xx;Password=<your pwd here>"

    Please be careful about storing the password into the script itself, it is not secure.

    HTH,

    Jivko Dobrev - MSFT
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, February 16, 2012

    Change report host server name?

    We have a SSRS web setup on one of our servers, and originally it was setup
    using the server's internal name. we want to be able to change this to use
    the external name. When you go to a report the frame which hosts the report
    output the src shows http://zweb/reportserver. we want this to show instead
    http://www.mycompany.com/reportserver. how can we change this?
    we tried changing the rsreportserver.config.
    We want to host the reports page under our clients sites so we can give them
    reports for their web stats and the like. So eg. we have a client named
    www.myclient.com. under their site, we made a virtual directory which points
    to the server\reports web site.
    Thanks in advance,
    - Arthur Dent.I have run into the same problem. I tried changing the baseUrl and I end
    up getting a 401 error.
    --
    Message posted via http://www.sqlmonster.com|||Found the answer to my problem here:
    http://www.sqljunkies.com/forums/showpost.aspx?postid=4393
    Also you may want to do a search on this term:
    ReportServerExternalURL
    It is a setting that microsoft says you need to set, but I couldn't get it
    to work. I got mine to work using the link above!
    Hope this helps!
    --
    Message posted via http://www.sqlmonster.com|||You need to make sure you have edited the RSReportManager.config file to
    point to the new server.
    --
    Brian Welcker
    Group Program Manager
    Microsoft SQL Server Reporting Services
    This posting is provided "AS IS" with no warranties, and confers no rights.
    "David Benedict via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
    news:9c496e631eb14a3f81be421acb338af7@.SQLMonster.com...
    >I have run into the same problem. I tried changing the baseUrl and I end
    > up getting a 401 error.
    > --
    > Message posted via http://www.sqlmonster.com

    Friday, February 10, 2012

    change mdf to sql authentication

    I have a web app, designed using VWD Express and using SQL 2005 Express. It has a mdf database called "client". It was created using security of windows authentication. I have already changed my instance of sql server express to accept mixed windows and sql authentication.

    How do I change my "client" database's permissions to the sql authentication? I need to add a user name and password as a requirement for my web host to be able to attach the mdf to their instance of sql 2005. It has to be the same user and password as I use with my web host's sql server 2005.

    Thank you in advance.

    Hi mlg74,

    Not very sure what you mean. Do you mena that, since you are going to upload your database to web hoster, you want to create a sql user name and password for your database?

    If my understanding is correct, based on my understanding,you have no need to do that. Database authentication is managed by database administration tools, not your database file itself(the mdf file).So, you can just upload your mdf file to the web host and ask for a sql user name & password.

    BTW, since you were using windows authentication before, you need to modify your connection string after authentication mode changed to "sql authentication". You can do that by simply remove "Intergrated Security=True" and add "User ID=username;Password=psw".

    Sample: <add name="constr_name" connectionString="Data Source=Server IP;Initial Catalog="DatabaseName";User ID=User Name;Password=PSW"
    providerName="System.Data.SqlClient" />

    If you also want to use sql authentication mode on your local machine, make sure you have sql management studio express downloaded https://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en. You can create a new sql authentication name/password through Security-->logins-->New logins in Management Studio Express.

    Hope my suggestion helps

    |||

    I know you are right, but my webhoster obviously doesn't know what they are doing. They told me I had to have the same usr name and password on my local machine as I do on the sqlserver 2005 on their server. But I am using windows authentication on my local express edition, but they said I had to make the passwords match anyway. The first time I uploaded the database files to the server for them to attach, I could no longer access my database on their server. So that's when I changed my authentication to mixed mode and had them re-attach it. But your saying it makes no difference, becasue those values are not stored in the .mdf, or .ldf files at all.

    What I did to finally make it work, was after they attached it, again I could not access it on their server. So out of frustration, I deleted it off their server and was going to start over. But when I created a new db on the server, I used the same password and username, and when it created, it was my attached db files, so I was happy! That was weird, and it's odd, how some webhosters dont know how to handle sql server 2005.