Change the Table name and conncetion dynamically of Crystal Report

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;


public partial class Reports_CurrencyReport : BasePage
{
CrystalReport objSubReport;

protected void Page_Load(object sender, EventArgs e)
{
try
{
if (Session["ObjReport"] != null)
{
ReportDocument reportdocument = new ReportDocument();
CrystalReport objrptcurr = new CrystalReport();
objrptcurr = (CrystalReport)Session["ObjReport"];
// objrptcurr.CreateView();
reportdocument.Load(Server.MapPath(objrptcurr.CrystalReport.ToString()));
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = System.Configuration.ConfigurationManager.AppSettings["VMasterDB"].ToString(); //"emast";
connectionInfo.ServerName = System.Configuration.ConfigurationManager.AppSettings["vSqlServer"].ToString(); //"user-pc";
connectionInfo.UserID = System.Configuration.ConfigurationManager.AppSettings["vSqlUserName"].ToString(); //"Sa";
connectionInfo.Password = System.Configuration.ConfigurationManager.AppSettings["vSqlPassword"].ToString(); //"sa@123";
Tables CrTables;
CrTables = reportdocument.Database.Tables;
foreach (Table crTable in CrTables)
{
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = connectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
// if you wish to change the schema name as well, you will need to set Location property as follows:
//crTable.Location = "<SCHEMA>." + crTable.Name;
crTable.Location = tMsg.tUser.sUserId.ToString() + "_" + crTable.LogOnInfo.TableName;
}

if (reportdocument.Subreports.Count >0)
{
foreach (ReportDocument rptdc in reportdocument.Subreports)
{
objSubReport = (CrystalReport)objrptcurr.CrSubObj;

SetDBLogonForSubreports(connectionInfo, rptdc, objSubReport);
}
}

CrystalReportViewer1.ReportSource = reportdocument;
}
}
catch (Exception)
{
throw;
}
}
private void SetDBLogonForSubreports(ConnectionInfo connectionInfo, ReportDocument reportDocument, CrystalReport ObjRpt)
{
ObjRpt.CreateView();
TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();
Tables CrTables;
CrTables = reportDocument.Database.Tables;

foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in CrTables)
{
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = connectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
// if you wish to change the schema name as well, you will need to set Location property as follows:
//crTable.Location = "<SCHEMA>." + crTable.Name;
crTable.Location = "ChangeTableName";
}
objSubReport = null;
}



}