There are several reports in the reportserver which are using a single dataSource. I am now using the asp.net reportviewer to view the reports on the report server. I now would like to change the datasource in the reportviewer so that depending on the passed in datasource, then the reports point to the correct datasource.
I have a reportviewer (Microsoft.ReportViewer.WebForms) control on my page. All my reports use one data source. I want to be able to let my reports run on a different database when started from my UAT enviroment. So the location of the reports is the same, but the data comes from a different db. I cannot seem to find how this is done, is it even possible?
EDIT: They are server reports on SQL Server . I know you can set the dataset programmaticaly but I just want the reports to point to a different db and leave the rest of the report intact.
I now have a ReportViewer control on asp.net page with datasource select Country, Product, Value from Table1. This reportviewer is associated with Report1.rdlc and currently Report1.rdlc has this matrix layout
Country as row field, Product as column field and value as Calculate field (Sum)
I want on button1click on asp.net, the report change to this layout:
Product as row field, Country as column field, value remains as Calculate field.
How should I proceed with this ? I know pointing to Report2.rdlc would be an option but I have more than 20 scenario and I want to keep doing it in same Report1.rdlc. Is there way to programmatically change the layout of Report1.rdlc when buttonclick is fired ?
I have a ReportViewer on page linked to Report1.rdlc. I want on buttonclick it link to Report2.rdlc and display new result accordingly. I tried below it refreshes but it does not change into Report2. Just stay as it was with Report1.rdlc.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) ReportViewer1.LocalReport.ReportPath = "Report2.rdlc" ReportViewer1.DataBind() End Sub
I have a vb.net web site. Currently it is generating reports via ReportViewer. The datasouce for the all reports is set at the deploying of the report.
ReportViewer is configured in the aspx page <rsweb:ReportViewer ID="myReportViewer" runat="server" ShowParameterPrompts="true" ZoomMode="Percent" Height="1100px" Width="1000px" BorderWidth="1"> </rsweb:ReportViewer>
I am setting up the ReportViewer using the following code.
Dim _cred As New ReportServerCredentials(Session("_ApplUser"), Session("_ApplPswd"), Session("_ApplDom")) 'Set the processing mode for the ReportViewer to Remote myReportViewer.ZoomPercent = 100 myReportViewer.Width = Unit.Percentage(100) myReportViewer.Height = Unit.Percentage(100) myReportViewer.ProcessingMode = ProcessingMode.Remote Dim _SrvRpt As ServerReport _SrvRpt = myReportViewer.ServerReport _SrvRpt.ReportServerCredentials = _cred 'Set the report server URL and report path _SrvRpt.ReportServerUrl = New Uri(Session("_RSConn")) _SrvRpt.ReportPath = Session("_RSFold") + _rr.Report_Path myReportViewer.ServerReport.Refresh() lblTitle.Text = _rr.Report_Title myReportViewer.ServerReport.Refresh() myReportViewer.Visible = True
What I want to do is dynamically set the datasource for a report at runtime. That is, I have 2 datasources already configured in my Report Manager. I want to have the vb.net pick which datasource based on a enviornment variable. So, if Env 1, then use Datasource 1 in the Report Manager. Of Env 2 then use Datasource 2 in the Report Manager. I have seen what looks like software for doing this Locally but no for Remote.
Public constr As String = ConfigurationSettings.AppSettings("ConnectionString") dim cnn As new SqlConnection(constr)
Now i need to create conditional report where user select parameters from Dropdownlist and based on that Report is generate on web page. I tried so much with the help of
http://www.aspfree.com/c/a/ASP.NET/Binding-Data-to-the-ReportViewer-Control-Dynamically-in-ASPNET-20/1/ article but noluck. The data is display when i select the SELECT query from wizard while add dataset, but i want to do it dynamically coz webserver is located somewher else. Configuration is MSSQL server 2000, W2K3, VS 2005 Professional.
I did a Crystalreport projects with vb6 with ado but i really dont know how to exactly dynamically generate conditional report in Reportviewer.
I'm running CR XI, and accessing .RPT files through a ReportViewer in my ASP.NET pages. I've already got the following code, which is supposed to set the Report Datasource dynamically.
rptSP = New ReportDocument Dim rptPath As String = Request.QueryString("report") rptSP.Load(rptPath.ToString, 0) Dim SConn As New System.Data.SqlClient.SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString) rptSP.DataSourceConnections(SConn.DataSource, SConn.InitialCatalog).SetConnection(SConn.DataSource, SConn.InitialCatalog, SConn.UserID, SConn.Password) Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo myConnectionInfo.ServerName = SConn.DataSource myConnectionInfo.DatabaseName = SConn.InitialCatalog myConnectionInfo.UserID = SConn.UserID myConnectionInfo.Password = SConn.Password
'Two new methods to loop through all objects and tables contained in the requested report and set 'login credentials for each object and table. SetDBLogonForReport(myConnectionInfo, rptSP) SetDBLogonForSubreports(myConnectionInfo, rptSP) Me.CrystalReportViewer1.ReportSource = rptSP
But when I go into each .RPT file, and open up the Database Expert section, there is obviously still servernames hardcoded in there, and the code listed above doesn't seem to be able to change the servernames that are hardcoded there.
I say this because I have training and production environments. When the .RPT file is hardcoded with my production server, and I open it on my training server with the code above (and the web.config has the training server in the connection string), I get the ol:
Object reference not set to an instance of an object.
And then if I go into the .RPT file, and change over the datasource to the training server, and try to open it again, it works fine. Why doesn't the code above overwrite the .RPT files datasource?
How can I avoid having to open up each .RPT and change the datasource when migrating reports from server to server? Is there a setting in the .RPT file I'm missing or something?
I have a Reportviewer with Objectdatasource as default datasource.
However I want the report to have a datasource with parameter depending on the label.text value so sqldatasource is ideal for this. However I dunno how to set the reportviewer datasource as sqldatasource control.
There 5 crystal reports which have the same fields. Each of them is using different store procedure as datasource as sp1, sp2...sp5 I have done first report rp1. I copied rp1 as rp2. How to change rp2 datasource from sp1 to sp2?
Let's say I have a table that holds information about books, with a column called bookid as a primary key with auto increment of 1. When I create a couple of records, it assigns 1 to the first row and 2 to the second row for the bookid column. If I delete the second row and enter another row, even though table now only has 2 records, the primary key column says 1 and 3 for their bookids. Is it possible to change back the bookid of the second record from 3 to 2 or is it just server assigned and can't be changed.
created a data source DS_QCategory that select data from a table but according a passed parameter which is a DDL selectvalue.I write the sql statement like this (select * from myTable where ({fn YEAR(tblarQuestions.QuestionDate)} LIKE (@QuestionDate)))this function will compare only the Year from my full date field with a DDL that include all Years like 2008, 2009, 2010 Then I create a report using reportviewer control and i defined the parameter in the bjectDataSource of the report then I added to my Years list in the DDL something like this "All" to select all data from myTable regardless the parameter so i created another Datasource DS_QCategoryAll to select all data from myTablewhat I need is to change the object data source of my report once "All" is selected: this is my code:
[Code]....
But get this error:
"
A data source instance has not been supplied for the data source 'DS_QCategory_tblarQuestionCategory' "
I am working on sql server 2000.I have only one instance running on SQL SERVER 2000.I have the instance name as 'ashvinDIT0934/sys07DIT' registered somehow.But i need to have it simply as 'mycompanyname' (no changes but as 'mycompanyname'). how i could change it and have the instance name changed.The instance name that i have given above i.e (ashvinDIT0934/sys07DIT) when inserted into the connectionstring does not work.It says as invalid escape sequence.So hence i need to have it as 'mycompanyname'
I have a Formview InsertTemplate a dropdownlist with datasource1 and I want onclick of an imagecontrol the dropdownlist will display another set of data from datasource2 instead.
Protected Sub ImageOnClick1(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Dim dropdownlist1 As DropDownList = CType(FormView1.FindControl("dropdownlist1"), DropDownList) [code]...
I want to call my business object class in which I have written my logic when any database status field change, what is the best way we can do, I want notification facility also.
I can do this window service. But there is any best way to acheive this like Notification and call my business object.
I would change the filterexpression depending to the choice of some DropDownList but, i've tryed with ObjectDataSource_Filtering event but it seems that non reevaluate the filter.is it the right event?i've to do any other operations after changing the filterexpression?
I am using SqlDataSource control to query my data via store procedure. Based on which option the user picked from the RadioButtonList control, I want to dynamically at run time to choose which store procedure gets executed. How do I do this? I am already using Query String for my parapmeters. I can could use this for the store procedure as well. The problem is, how do I get the SelectCommand to pick the store procedure name from the parameter passed in the URL?