|
I have One Excel sheet and i want record from that
excel sheet where first column rows contains Manager word
how do i use like query?
|
|
|
|
|
Hi friends,
I am using reports in my application. In reportviewer i am using local report in my code.Its working well. But for print icon display is needed in my application.So i am using server report. But errors occurred in the code.
The Error is " datasource is not a member of Microsoft.Reporting.WebForms.ServerReport". What can i do? I can't run the application using serverreport.
For ur's reference i put the code using local report
Page.Title = "Reports Based On Company"
dsGetValue = New DataSet
objReport = New clsReport
ReportViewer1.ProcessingMode = ProcessingMode.Local
ReportViewer1.LocalReport.DataSources.Clear()
Dim report As LocalReport = ReportViewer1.LocalReport
dsGetValue = New DataSet
If paramCompanyName = "All" Then
'Temp DataTable to Concatenate the Address fields
dtTempTimeSheet = New DataTable
'Temp DataSet to Concatenate the Address fields
dsgetTempSheet = New DataSet
dtTempTimeSheet.Clear()
dsgetTempSheet.DataSetName = "PmsDataSet"
' Add the new table
dtTempTimeSheet = dsgetTempSheet.Tables.Add("DataTable3")
' Define the columns
With dtTempTimeSheet
.Columns.Add("strCompanyName", System.Type.GetType("System.String"))
.Columns.Add("strRelationshipType", System.Type.GetType("System.String"))
.Columns.Add("strAddress1", System.Type.GetType("System.String"))
.Columns.Add("strContactNo", System.Type.GetType("System.String"))
.Columns.Add("strWebsite", System.Type.GetType("System.String"))
End With
dsGetValue = objReport.getDetailedReportForCompany(paramstrRelationshipType, paramCompanyName)
For intloop = 0 To dsGetValue.Tables(0).Rows.Count - 1
dbrow = dtTempTimeSheet.NewRow
With dbrow
.Item("strCompanyName") = dsGetValue.Tables(0).Rows(intloop)(0)
.Item("strRelationshipType") = dsGetValue.Tables(0).Rows(intloop)(9)
.Item("strAddress1") = dsGetValue.Tables(0).Rows(intloop)(4) + "," + dsGetValue.Tables(0).Rows(intloop)(10)
.Item("strContactNo") = dsGetValue.Tables(0).Rows(intloop)(6)
.Item("strWebsite") = dsGetValue.Tables(0).Rows(intloop)(2)
'Add New Row
dtTempTimeSheet.Rows.Add(dbrow)
End With
Next
End If
'This Case Works If The Selected Company Name Is All
If paramCompanyName = "All" Then
Select Case dsgetTempSheet.Tables(0).Rows.Count
Case Is > CInt(0)
report.ReportPath = "ReportsNewUI/CompRelType.rdlc"
Case Else
report.ReportPath = "ReportsNewUI/ReportWithError.rdlc"
End Select
Try
Dim strDatasource As New ReportDataSource()
strDatasource.Name = "PmsDataSet_DataTable3"
strDatasource.Value = dsgetTempSheet.Tables("DataTable3")
report.DataSources.Add(strDatasource)
Catch ex As Exception
End Try
'This Case Works If The Selected Company Name Is All
ElseIf paramCompanyName <> "All" And paramstrRelationshipType = "All" Then
dsGetValue = objReport.getDetailedReportForCompany(paramstrRelationshipType, paramCompanyName)
Select Case dsGetValue.Tables(0).Rows.Count
Case Is > CInt(0)
'report.ReportPath = "ReportsNewUI/detailedReportForCompanyDetails.rdlc"
report.ReportPath = "ReportsNewUI/ReportWithCompanyInformation.rdlc"
Case Else
report.ReportPath = "ReportsNewUI/ReportWithError.rdlc"
End Select
Try
Dim strDatasource As New ReportDataSource()
strDatasource.Name = "PmsDataSet_DataTable3"
strDatasource.Value = dsGetValue.Tables("DataTable3")
report.DataSources.Add(strDatasource)
Catch ex As Exception
End Try
ElseIf paramCompanyName <> "All" And paramstrRelationshipType <> "All" Then
dsGetValue = objReport.getDetailedReportForCompany(paramstrRelationshipType, paramCompanyName)
Select Case dsGetValue.Tables(0).Rows.Count
Case Is > CInt(0)
'report.ReportPath = "ReportsNewUI/detailedReportForCompanyDetails.rdlc"
report.ReportPath = "ReportsNewUI/ReportWithCompanyInformation.rdlc"
Case Else
report.ReportPath = "ReportsNewUI/ReportWithError.rdlc"
End Select
Try
Dim strDatasource As New ReportDataSource()
strDatasource.Name = "PmsDataSet_DataTable3"
strDatasource.Value = dsGetValue.Tables("DataTable3")
report.DataSources.Add(strDatasource)
'Send Paramteres To Report File
'Dim StatusParameter As New ReportParameter()
'StatusParameter.Name = "strCompanyName"
'StatusParameter.Values.Add("Company Name" & " " & paramCompanyName)
'Dim parameter() As ReportParameter = {StatusParameter}
'report.SetParameters(parameter)
Catch ex As Exception
End Try
End If
Finally
dsGetValue = Nothing
objReport = Nothing
I hope ur's reply soon.
Thanks
Every Successful Person Have A Painful Story
|
|
|
|
|
how to copy structure of gridview to other gridview
|
|
|
|
|
What do you mean by structure? You mean columns?
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Mhiny wrote: how to copy structure of gridview to other gridview
do you want copy one grid view data to another Grid view or Copy only the fields ?
cheers,
Abhijit
|
|
|
|
|
yes.i want to copy column's structure from first gridview to second gridview at runtime.
|
|
|
|
|
I guess you should add columns dynamically rather then copying them.
An after thought to my previous answer. I think DataGridView.Clone property will solve your problem as well
Ahsan Ullah
Senior Software Engineer
modified on Tuesday, August 19, 2008 1:36 AM
|
|
|
|
|
then do the same thing that you have done for grid1.
cheers,
Abhijit
|
|
|
|
|
|
Hi,
Me and my friends are developing a software.The software is for designing and customising business cards.
In this software user can rearrange the name and address in it.that means user can drag each control and place it in their own decision.In it we cannot restore the whole one with keeping position.in one resolution it is working perfectly.but changing the resolution a computer.it is not keeping the position.
Could you help me to solve this problem.
thanks and regards.
Rasma
www.rasma.dom.ir[^]
|
|
|
|
|
You're doing drag and drop in a web application ?
Obviously you need to write resolution agnostic code.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
i think if you use % instead px.
I will do my best?
|
|
|
|
|
I don't think it's even clear that he's using ASP.NET, I doubt he is.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
sorry mr. Christian Graus but i didn't mean what u want to say "I don't think it's even clear that he's using ASP.NET, I doubt he is." will you clear what you want to say?
I will do my best?
|
|
|
|
|
|
Thank You guys for your response. I would like give the actual idea about our project. The core part of this project is to provide the customer a tool by which the customer can select a design from a collection. From there the application provides the tools for making the business cards according to their idea. i. e they can drag any field for eg: the name, address, or the phone no. Then they can change the font the colour .. . We were succeed in creating these all . We are storing the X,Y co-ordinates of each field and we have to restore all these fields for that customer to view later. At that time on the normal screeen resolution the restoring is successfully happened. But if we changed our screen resolution then the background image exists without any problem but the fields are not keeping the saved position. Here we are of no idea that how we have to set this for every screen resolutiong available in any system. Here the width and height of the Background image i.e the business card is set to a width of 300 px and height of 200 px. We have used divs for each data field in this business card.
We expect a good solution from all of you.
Thanks and regards
Rasma
|
|
|
|
|
test test test test test test test test
|
|
|
|
|
Here is my code.
Front end
<asp:scriptmanagerproxy id="ScriptManagerProxy1" runat="server" xmlns:asp="#unknown">
</asp:scriptmanagerproxy>
<asp:timer id="Timer1" runat="server" interval="1000" ontick="Timer1_Tick1" xmlns:asp="#unknown">
</asp:timer>
<asp:updatepanel id="UpdatePanel1" runat="server" updatemode="Always" xmlns:asp="#unknown">
<contenttemplate>
<asp:panel id="PanelHeader" runat="server" cssclass="">
</asp:panel>
</contenttemplate>
<triggers>
<asp:asyncpostbacktrigger controlid="Timer1" eventname="Tick" />
</triggers>
</asp:updatepanel>
codebehind
Protected Sub Timer1_Tick1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
MyEven!
End Sub
it never triggers the tick?
i dont know what it cant be.
|
|
|
|
|
How can i disable panes so they do not expand on click until i change it via code behind?
Thank you for your help.
|
|
|
|
|
I am using .net 2005.i am doing my project in asp.net.my project title is master log attendance.how to get all employee id in to single variable?
We have got employee id from single table by using single variable.but the datas are displayed for final id only.but we want to get more employee id from single variable.
The following code
protected void img_submit_Click(object sender, ImageClickEventArgs e)
{
from_date = txt_fr_date.Text;
to_date = txt_to_date.Text;
emp_name = ddl_emp_name.SelectedValue;
check();
}
void check()
{
System.TimeSpan dt_diff = Convert.ToDateTime(to_date).Subtract(Convert.ToDateTime(from_date));
days = dt_diff.Days;
dt.Columns.Add(new DataColumn("ID", typeof(string)));
dt.Columns.Add(new DataColumn("Name", typeof(string)));
string empid1;
com = new SqlCommand("select distinct(emp_id) from tbl_report", con);
dr = com.ExecuteReader();
while (dr.Read())
{
empid1 = dr.GetString(0);
}
dr.Close();
for (int i = 0; i <= days; i++)
{
sql_date = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
sql_date1 = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
dt.Columns.Add(new DataColumn(sql_date1, typeof(string)));
drow = dt.NewRow();
com = new SqlCommand("select distinct rpt.emp_id as EmployeeID,card.username as EmployeeName,min(case when rpt.datetime1='" + sql_date + "' then rpt.datetime1 end) as '" + sql_date + "' from tbl_card as card,tbl_report as rpt where card.fkdata=rpt.emp_id and rpt.datetime1='" + sql_date + "' and emp_id='" + empid1 + "' group by rpt.emp_id,card.username", con);
dr = com.ExecuteReader();
while (dr.Read())
{
drow[0] = dr.GetString(0);
drow[1] = dr.GetString(1);
drow[i+2] ="x";
dt.Rows.Add(drow);
}
dr.Close();
}
GV_musterrole.DataSource = new DataView(dt);
GV_musterrole.DataBind();
}
in above code,i get all employee id into variable name as empid1.then i put empid1 for employeeid field in where condition of query in for loop.
but displayed only one employee id as follow in grid view,
--ID----Name---10/11/2007--10/12/2007--10/13/2007--10/14/2007--10/15/2007
--370--ramesh---------------------------------------------------------------x
so i want to get all employee id into single variable name as empid1.then put empid1 for employeeid field in where condition of query means,i want to come all employee id details as follow.
--ID----Name---10/11/2007--10/12/2007--10/13/2007--10/14/2007--10/15/2007
--366--dinesh---------------------------x-----------------x----------------x
--367--ram------------------------------x-----------------------------------
--369--guru-----------------------------x----------------------------------x
--370--ramesh--------------------------------------------------------------x
|
|
|
|
|
ram67 wrote: We have got employee id from single table by using single variable.but the datas are displayed for final id only.but we want to get more employee id from single variable.
Have a bit of patience dude. Dont repost as its not gonna help you anyway.
Next, posting your complete code wont help.
Be specific and clear about your problem.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Too impatient to wait for original post.
Blog link to be reinstated at a later date.
|
|
|
|
|
XML.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hey guys, I'm trying to use a master and detail type of datagrid, when I select a row for a file, I want to get the details of homany times it has been downloaded and who has downloaded it from another table ! I get an error when I use this code !
int FileID = (int)GridView1.DataKeys[GridView1.SelectedIndex];
the error:
CS0030: Cannot convert type 'System.Web.UI.WebControls.DataKey' to 'int'
Even I tried to add SelectedDataKey in the property of my master grid and then use the following code to get it !
int FileID = (int)GridView1.SelectedDataKey.Values[0];
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds);
DetailsView1.DataSource = ds.Tables[0];
DetailsView1.DataBind();
the error:
System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'FileID'.
I ve gone through many articles and I ve gotten to the same conclusion that the code is correct but somehow there is something wrong with mine !!!
Please help me out !
|
|
|
|
|
am using .net 2005.i am doing my project in asp.net.
my project title is master log attendance.
i want to display datas in single row for same name and id.
i have 2 table named as attendance and employeedetails.
The following code has worked very well.But datas are displayed in multiple row for same name and id.
protected void img_submit_Click(object sender, ImageClickEventArgs e)
{
from_date = txt_fr_date.Text;
to_date = txt_to_date.Text;
emp_name = ddl_emp_name.SelectedValue;
check();
}
void check()
{
System.TimeSpan dt_diff = Convert.ToDateTime(to_date).Subtract(Convert.ToDateTime(from_date));
days = dt_diff.Days;
dt.Columns.Add(new DataColumn("ID", typeof(string)));
dt.Columns.Add(new DataColumn("Name", typeof(string)));
for (int i = 0; i <= days; i++)
{
sql_date = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
sql_date1 = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
dt.Columns.Add(new DataColumn(sql_date1, typeof(string)));
drow = dt.NewRow();
com = new SqlCommand("select distinct rpt.emp_id as EmployeeID,card.username as EmployeeName,min(case when rpt.datetime1='" + sql_date + "' then rpt.datetime1 end) as '" + sql_date + "' from tbl_card as card,tbl_report as rpt where card.fkdata=rpt.emp_id and rpt.datetime1='" + sql_date + "' and emp_id='366' group by rpt.emp_id,card.username", con);
dr = com.ExecuteReader();
while (dr.Read())
{
drow[0] = dr.GetString(0);
drow[1] = dr.GetString(1);
drow[i+2] ="x";
dt.Rows.Add(drow);
}
dr.Close();
}
GV_musterrole.DataSource = new DataView(dt);
GV_musterrole.DataBind();
}
in above code,i applied query with groupby and distinct in for loop statement.
using above code,the following output is coming in grid view,
--ID----Name---10/11/2007--10/12/2007--10/13/2007--10/14/2007--10/15/2007
--366--dinesh---------------------------x
--366--dinesh-------------------------------------------x
--366--dinesh---------------------------------------------------------------x
here 3 lines are displayed using for loop statement for same name and id.
But I want to display in single line using for loop statement for same name and id as following output.How to do this?
--ID----Name---10/11/2007--10/12/2007--10/13/2007--10/14/2007--10/15/2007
--366--dinesh---------------------------x-----------------x----------------x
|
|
|
|