Topic: Datasource Location For crystel report
Oldest Post First
Newest Post First
Author
Message
ManKhl
Newbie
Joined: 01 Aug 2011
Online Status: Offline
Posts: 4
Topic: Datasource Location For crystel report Posted: 03 Aug 2011 at 11:26pm
I'v developed an application.which works very fine on my pc. I havent done any hardcode there. I Have following code on my crystel reportviewer
private void crystalReportViewer1_Load(object sender, EventArgs e)
{
HMSCon=new HMSConnection();
connectionString = HMSCon.cn.ConnectionString;
builder = new SqlConnectionStringBuilder(connectionString);
password = builder.Password;
username = builder.UserID;
dataSource = builder.DataSource;
initialCatalog = builder.InitialCatalog;
myTBInfo = new TableLogOnInfo();
myTBInfos = new TableLogOnInfos();
myConn = new ConnectionInfo();
myConn.ServerName = dataSource;
myConn.DatabaseName = initialCatalog;
myConn.Password = password;
myConn.UserID = username;
myTBInfo.ConnectionInfo = myConn;
myTBInfos.Add(myTBInfo);
crystalReportViewer1.LogOnInfo = myTBInfos;
try
{
report = new FinalBillLodgingAndServices();
Lodgingreport = new FinalLodgingReportBill();
Servicereport = new FinalServiceBill();
String[] arrlis = (String[])RoomList.ToArray(typeof(string));
String[] servarrlis = (String[])ServiceroomsList.ToArray(typeof(string));
report.SetParameterValue("BookingId", bkinid);
report.SetParameterValue("RoomNames", arrlis);
report.SetParameterValue("BillStatus", "Paid");
report.SetParameterValue("LodgingPaybale", LodgingPayble);
report.SetParameterValue("AmountInWord", NetAmountINword);
report.SetParameterValue("PaybleServiceAmount", ServiceAmount,"FinalBillRoomServiceSubreport");
report.SetParameterValue("Rooms", servarrlis, "FinalBillRoomServiceSubreport");
crystalReportViewer1.ReportSource = report;
crystalReportViewer1.Refresh();
}
catch(Exception ex)
{
MessageBox.Show(""+ex);
}
}
but when i try to run that application on other pc it needs to set datasource location. and i need to rplace sql server name every time ..is der any way to open crystel report without seting this.
Develope the unique
IP Logged
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum
This page was generated in 0.031 seconds.