Crystal Reports Reportviewer - Set Datasource Dynamically Not Working?
Mar 25, 2010
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?
View 2 Replies
Similar Messages:
Apr 6, 2010
I have already generated crystal reports but i've made them static. but now i want to make the user to select the criteria for generating the reports. for eg., in one of them i want to show monthwise data so user should be able to select the month and year and that would be passed as parameter and compared to the existing data. provide me with proper exact code that can be used for giving parameters in such a report using C#.
View 3 Replies
Feb 9, 2011
That's pretty much it. A graphic in the header shows fine in CR Developer (2008), but doesn't show in the web report viewer control.
The data in the report looks o.k., it's just rendering a broken image when I test the report, with an address like this:
http://localhost:52491/CrystalImageHandler.aspx?dynamicimage=cr_tmp_image_bd87400a-878c-49de-979e-5ab0d4db8c80.png
I put my project on our webserver and rigged up a test URL, same there--so it's not restricted to the project being run out of VS 2010.
View 1 Replies
Mar 13, 2014
my requirement is to add crystal report in my project which is developed in visual studio 2010 windows application.i have installed SAP Crystal report for VS2010 Successfully.but i cant find the control Crystl report viewer in my Toolbox.how to enable Crystal report viewer in VS2010 windows application.
View 1 Replies
Nov 30, 2013
Binding the image as the report paramater in rdlc. I am using report viewer.
View 1 Replies
Jun 10, 2010
I'm having issues using the Print/Export functions from the CrystalReportViewer toolbar in Visual Studio 2005. In some cases, the print/export dialog window is simply replaced with the report page, instead of exporting/printing the data. Based on a dropdown box, the Report Document is loaded with a different report file:
If ddReport.SelectedValue = "Report-1" Then rptDoc1.Load(Server.MapPath("/Reports/Report1.rpt"))Else rptDoc1.Load(Server.MapPath("/Reports/Report2.rpt"))End If
View 1 Replies
Apr 13, 2013
I have master page, menu on master page, i use asp roles and trim menu item based on user roles and rights this process is working fine.
Now i have to create some reports based on user roles, and responsibility in a company like country head will view country wide reports, manager region will only view regional report and rest will view reports related to them.
How can i achieve this efficiently using asp roles.
View 1 Replies
Feb 24, 2011
I am trying to use crystal report for my project. I have made .rpt file as instructions in the tutorials now the problem is with crystal report viewer control... i hav set its its report source to the one that i have made using its properties.. but still its not working..I am using professional edition of visual studio 2008 with .net frameowrk 3.5
View 3 Replies
Feb 24, 2010
I have created a crystal report application using VS 2005 on my Dev machine, it worked correctly.On another machine where VS 2005 is also installed, it is not working.
The DLL that is giving error is:
<add
assembly="CrystalDecisions.ReportAppServer.ClientDoc,
Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
If I search for this DLL on my Dev machine, I can't find it.
View 1 Replies
Aug 5, 2010
When i run the application locally it works fine but when i publish it n access from it it gives the error asEither the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.
View 2 Replies
Nov 12, 2010
In the Crystal reports, I'm grouping by the Agency that is further grouped by the Clients name. I have a CheckBox on the page to print each client on a new page. Is it possible to set New Page After dynamically if this CheckBox is checked?
View 2 Replies
May 9, 2010
Is there a way to dynamically create a report?I have the following tables:
[Code]....
Obviously, this is quite straight forward if I could restrict the limit of the sizes, but they want the flexibility to add sizes, particularly with footwear or if they should need to add women's dress sizes.So the problem is that I'm generating dynamic table columns (the number unknown) during run-time.
View 2 Replies
Oct 14, 2010
i have designed a rdlc file with a few text boxes and given the dataset and defined the parameters in it. now my requirement is that in my report form i have a text box if the user enters a number say "2" or more that should dynamically generate two or more copies in the same rdlc.
View 1 Replies
Jun 16, 2015
How to pass sql query to crystal report programmatically using c#
View 1 Replies
Feb 9, 2010
i am facing one problem that i wanted to visible and hide crystal report data coloumns according to their User type
the dataset is common for all the users.
i had substitude solution for this problem by creating different .rpt files for each user type
but i want to do it Dynamically because in future the user types will get increase
is it possible to visible and hide data columns of crystal report Dynamically
View 3 Replies
Dec 29, 2010
i am working with one student management system. i want to do following task : whenever i clicked on NEXT(Arrow) button in crystal report then next student report should be displayed. All the details stored in db "next" button fetch the details of student from db and desplayed in crystal report. so, what is the steps and solution for this task?
View 1 Replies
Aug 2, 2010
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.
View 5 Replies
Jun 13, 2010
I'm new to Visual Studio.NET . I need to integrate the crystal reports into an ASP.NET application. I generated Crystal report with the help of crystal report XI developer edition(Stand alone version and NOT from the one which comes from visual studio).
How to integrate this report with the web application.
View 1 Replies
Jul 16, 2010
We have quite a few reports which were developed earlier in Crystal Reports 8.5. We are now planning to use these reports in our web application developed in VS 2008 (C#).
What dlls are needed for calling 8.5 in the application and how should they be added to the application while shipping it to the client?
They are also struggling to get the code running. Would also need the code to call the report with parameters.
View 9 Replies
Sep 6, 2010
I've just upgraded a visual studio.net 2003 project (asp.net 1.1) to visual studio.net 2010 (asp.net 4.0). I'm encountering a problem with viewing Crystal reports. I'm using Visual Studio Development Server as a Web Server.
When I try to create a new report (via code that worked fine previously) the line below causes the webserver40.exe to crash.
Protected WithEvents MyRep As New CrystalDecisions.CrystalReports.Engine.ReportDocument
I've got Crystal Reports 11 installed.
View 1 Replies
Mar 12, 2010
I'm using vs2005 asp .net using c#and i using the crystal report viewer to create my report and preview the report using crystal report viewer. When i run the application, i can preview the report well in the form, but when i click any button of th tool bar then a blank page is getting displayed.
View 5 Replies
Nov 14, 2010
I generate report using parameters.I pass parameter on run time & report is generated. For Example: At first i am displaying A list of customers having SEX = MALE. Than I enter SEX = FEMALE. But it still displaying the MALE list Results. If i rebuild my webform and than put parameter FEMALE then it displays. So, If i generate a report once. I dont want to rebuild my webform to pass new parameter. . How it should be Done. I added one line code CrystalreportViewer1.RefreshReport(); but it did not work for me. I am using VS 2010..
View 1 Replies
Sep 3, 2010
i'm going to create a reports for the database..i dont want to link the database dynamically instead i want to write the program for that..
View 1 Replies
Mar 8, 2013
In crystal report, how to increase column width and height dynamically?
View 1 Replies
Dec 17, 2010
My report is displayed without any problem. However, when I click on the button from my crystal report viewer toolbars I get the error. Note : the toolbars is working fine on my local machine.
Error message : Logon failed. Details: mscorlib : Could not find a part of the path 'C:Documents and SettingschiaMy DocumentsVisual Studio 2008WebSitesSafety Permit System
ptLoad_ConfineSpace_Summary.xml'. Error in File C:WINDOWSTEMP
ptPrintSummaryConfineSpace
{965CF937-D48C-483A-AC32-198A790880A6}.rpt: Unable to connect: incorrect log on parameters.
View 14 Replies