|
What is in query and can you share the declarations for row and results.
Also - shortening the amount of XML we have to copy would be nice.
When you say "show it correctly" what do you mean by "correctly"?
modified 19-Apr-17 7:25am.
|
|
|
|
|
row[i] indicates a "column" (indexed via i).
One needs to populate all columns in a (datatable) row that you're writing; you're only populating one column at a time.
You need to populate each column as you retrieve the (xml) values for that column and row.
You're also attempting to do this in the crudest way possible (no xml deserialization; no datarow column naming).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
hi
here is my code Rdlc not binding data's in reportviewer pls any one help
protected void btnSearch_Click(object sender, EventArgs e)
{
DivReport.Visible = true;
GetMonthWiseReports();
}
private void GetMonthWiseReports()
{
string LocationName = string.Empty, CompanyName = string.Empty;
try
{
rptvw.Reset();
rptvw.ProcessingMode = ProcessingMode.Local;
rptvw.LocalReport.ReportPath = Server.MapPath("~/Reports/RDLC/MonthWiseLedger.rdlc");
string accname = string.Empty;
Int64 AccNo = 0;
//string frmdate = string.Empty;
//string todate = string.Empty;
//frmdate = Convert.ToDateTime(rdFrmDate.SelectedDate).ToString("yyyy-MM-dd");
//todate = Convert.ToDateTime(rdToDate.SelectedDate).ToString("yyyy-MM-dd");
DataTable dt_PurchaseData = SerLedgerMaster.GetMonthwiseledgerReport(AccNo).Tables[0];
dt_PurchaseData.Columns.Add("Serial_No");
Int32 RowCount = 0;
foreach (DataRow dr in dt_PurchaseData.Rows)
{
RowCount++;
dr["Serial_No"] = RowCount;
}
ReportDataSource rptSource = new ReportDataSource("MonthWiseLedger", dt_PurchaseData);
rptvw.LocalReport.DataSources.Add(rptSource);
rptvw.LocalReport.Refresh();
}
catch (Exception ex)
{
throw (ex);
}
}
public static DataSet GetMonthwiseledgerReport(Int64 accname)
{
try
{
MySqlConnection mySQLConnection = new MySqlConnection(ConfigurationManager.ConnectionStrings["MMDBConn"].ToString());
DataSet objDataSet = new DataSet();
MySqlCommand command = new MySqlCommand();
command.Connection = mySQLConnection;
command.CommandType = CommandType.StoredProcedure;
command.CommandTimeout = 600;
command.CommandText = "USP_GetMonthWiseLedger";
command.Parameters.Add("@AccNo", MySqlDbType.Int64).Value = accname;
mySQLConnection.Open();
MySqlDataAdapter SqlDa = new MySqlDataAdapter(command);
SqlDa.Fill(objDataSet);
int count = objDataSet.Tables[0].Rows.Count;
return objDataSet;
}
catch (Exception ex)
{
throw (ex);
}
}
|
|
|
|
|
I'm sorry I don't understand. Can you rephrase your question please?
|
|
|
|
|
Hi here is my code, i want to show data in the report for selected accno in the dropdown list
thank you for ur reply
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CurUserID = Convert.ToInt64(Session["UserID"]);
CurrLocID = Convert.ToInt64(HttpContext.Current.Session["LocID"]);
CurrCompID = Convert.ToInt64(HttpContext.Current.Session["CompID"]);
if (CurUserID == 0)
{
Response.Redirect("~/Logout.aspx");
}
else
{
BindAccounDetails();
GetMonthWiseReports();
}
}
}
private void BindAccounDetails()
{
CurrLocID = Convert.ToInt64(HttpContext.Current.Session["LocID"]);
CurrCompID = Convert.ToInt64(HttpContext.Current.Session["CompID"]);
try
{
DataTable dt = new DataTable();
SerChequePaymentDetails SerObjChq = new SerChequePaymentDetails();
dt = SerObjChq.BindAccounDetails(CurrLocID, CurrCompID);
ddlAccname.DataSource = dt;
ddlAccname.DataTextField = "Acc_Name";
ddlAccname.DataValueField = "Acc_No";
ddlAccname.DataBind();
RadComboBoxItem item = new RadComboBoxItem("Select", "0");
ddlAccname.Items.Insert(0, item);
}
catch (Exception ex)
{
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
DivReport.Visible = true;
GetMonthWiseReports();
}
private void GetMonthWiseReports()
{
string LocationName = string.Empty, CompanyName = string.Empty;
try
{
rptvw.Reset();
rptvw.ProcessingMode = ProcessingMode.Local;
rptvw.LocalReport.ReportPath = Server.MapPath("~/Reports/RDLC/MonthWiseLedger.rdlc");
string accname = string.Empty;
Int64 AccNo = 0;
DataTable dt_PurchaseData = SerLedgerMaster.GetMonthwiseledgerReport(AccNo).Tables[0];
dt_PurchaseData.Columns.Add("Serial_No");
Int32 RowCount = 0;
foreach (DataRow dr in dt_PurchaseData.Rows)
{
RowCount++;
dr["Serial_No"] = RowCount;
}
ReportDataSource rptSource = new ReportDataSource("MonthWiseLedger", dt_PurchaseData);
rptvw.LocalReport.DataSources.Add(rptSource);
rptvw.LocalReport.Refresh();
}
catch (Exception ex)
{
throw (ex);
}
}
public static DataSet GetMonthwiseledgerReport(Int64 accname)
{
try
{
MySqlConnection mySQLConnection = new MySqlConnection(ConfigurationManager.ConnectionStrings["MMDBConn"].ToString());
DataSet objDataSet = new DataSet();
MySqlCommand command = new MySqlCommand();
command.Connection = mySQLConnection;
command.CommandType = CommandType.StoredProcedure;
command.CommandTimeout = 600;
command.CommandText = "USP_GetMonthWiseLedger";
command.Parameters.Add("@AccNo", MySqlDbType.Int64).Value = accname;
mySQLConnection.Open();
MySqlDataAdapter SqlDa = new MySqlDataAdapter(command);
SqlDa.Fill(objDataSet);
int count = objDataSet.Tables[0].Rows.Count;
return objDataSet;
}
catch (Exception ex)
{
throw (ex);
}
}
|
|
|
|
|
Ok - I get what you want to do, I get that you have some code. But what is the actual problem? (or question)
|
|
|
|
|
hi
report structure only visible i click the button...nothing data inside my report that is problem
|
|
|
|
|
Have you seen the suggestion from vinod.jangle below? You do not appear to have used DataBind()
|
|
|
|
|
I have no much idea on reports but don't you need "
DataBind(); " for your reportviewer control?
modified 20-Sep-20 21:01pm.
|
|
|
|
|
|
Want get the added/updated files in msp over msi. can we do that in C#?
thanks in advance...
|
|
|
|
|
If you want those files in msp file, then write them there, there is no need to generate a new msi for that. However, since the msp file contains patches to a previous installation, you need to create an msp using those two msi — so that the executable knows which patches to install. This help documentation on Windows developer website will help you in understanding what programs you require to use in order to generate an msp file; Msimsp.exe (Windows).
What problem are you facing?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Actually I am looking for newly added files in patch. can you achieve it by comparing MSI and MSP files using C# code?
|
|
|
|
|
Ho do i upgrade my cell phone softwares?
|
|
|
|
|
What does this have to do with writing code in C#?
|
|
|
|
|
Maybe he was of those antiquities known as Windows Phone
|
|
|
|
|
I have created a menu in matlab and onclick of the menu I have m script that will call c# DLL. This I have done using add assembly. And am passing few values to the c# DLL like guid and name. In c# DLL I am invoking a dialogue box with these MATLAB information. From the c# dialogue box everytime based on the user selection (using guid) I have to highlight model in matlab. And when the dialogue box is closed I need to update some values in matlab model. And also When the dialog box is launched I should also able to scroll and zoom in my MATLAB model. I have tried with delegate and event but I can't able to zoom/scroll my MATLAB model. I can't make my dialog box modeless because after invoking I can't able to access my event listener in MATLAB. And also connection between MATLAB and c# is cut and I don't want that to happen.
My code looks like this and am having a model dialog box running separately apart from the code provided,
[^]
modified 14-Apr-17 3:59am.
|
|
|
|
|
Nah. I would call Matlab from C#; not the other way around.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
my login page code:
if (dr[2].ToString() == "Executive Engineer" || dr[2].ToString() == "Deputy Executive Engineer")
{
if (txtUserId.Text == dr[0].ToString() && txtPassword.Text == dr[1].ToString())
{
Session["id"] = txtUserId.Text;
Response.Redirect("SuperAdminPanel.aspx", false);
}
}
my SupperAdmin page code:
if (Session["id"] != null )
{
//business code something
but when we request some othet page came back on supperAdmin page we got null session
what we do?
sorry for poor language i'm new in dot.Net
thank you
|
|
|
|
|
You are getting session null if you did not landed on those other pages from login page. As you setting
Session["id"] = txtUserId.Text; only on LOGIN page.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
waghniteen wrote: what we do? You figure out why it is null. Did the Session timeout? Do you have code somewhere that resets the session values? Are you testing for session inside a WebMethod? We have no way of knowing since we can't see your code or your environment.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
it's not a session timeout problem we place blow code in config
<sessionstate cookieless="false" regenerateexpiredsessionid="true" timeout="200">
<providers>
<clear>
|
|
|
|
|
You also need to check IIS settings to make sure the app pool is not being recycled. And check event viewer for any problems.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
when we host website on my domain that time we get this problem. not get on localhost
|
|
|
|
|
You're still going to have to troubleshoot on your own.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|