|
Other way?
can you explain your scenario ? you can use following syntax
currentRow += 1;
currentRow ++;
currentRow = currentRow + 1
|
|
|
|
|
Hi,
I have a web application running SSRS reports 2005 via rsweb:ReportViewer control
The reports are generated fine on IE 7-8 browsers. However I'm having some issues on the IE10.
When clicking on a hyperlink on the main report to load the sub report, the sub report is not generated in the rsweb:ReportViewer control. It navigates away from my application and it is generated in a new browser window. Also in the address bar of the browser. I've noticed that the URL of the report server is displayed with all the report parameters as query string. This is happening in IE 10 only.
Any idea how to resolve this issue?
Cheers
|
|
|
|
|
Add the following code snippet in web.config file:
<system.webServer>
<httpProtocol>
<customHeaders>
<clear/>
<add name="X-UA-Compatible" value="IE=8"/>
</customHeaders>
</httpProtocol>
<system.webServer>
Look at life through the windshield, not the rear-view mirror
|
|
|
|
|
Thanks for the reply DamithSL. I've tried your solution but it didn't resolve the issue.
Should the code be added to the config file of the web application or to the config file of the Report Server?
Thanks
|
|
|
|
|
During the publishing of my web application using VS 2010 I get the following message,
Web deployment task failed. (There was an error reading IIS configuration schema from 'C:\WINDOWS\system32\inetsrv\config\schema\'.)
Can anyone please advice me the resolution?
regards
Sultan
|
|
|
|
|
|
I've never used the web deployment, well maybe during VS2005 but that was almost 10 years ago.
Back in the old days, you use to be able to setup your IIS 5 / IIS 6 web server using software, that can read and write the IIS website metabase config files in the windows operating system. Very easy to read and write too using managed code or c++ on Windows XP.
Since IIS 7, the web config is now written to the web.config file in your project folder. So you just copy the project to your server, and just point IIS 7+ folder path to the web site project folder. Now you click on the bind link to test the bind to the server.
I'm pretty sure that the feature your speaking about is legacy, and I'm not really sure why it's still there. Some folks still use IIS 5 and IIS 6 to host web sites on, which is not very secure in today's world.
The Application pool is not written to the web config, so you have to program that by hand. If your having trouble programming the app pool, or setting permissions for the app pool in the website folder, That's another complex project.
I like the new system, because deployment time is much faster now.
Sample system.webServer. This sample programs the default page name, sets the maximum upload size, and sets compression for static and dynamic pages to TRUE. You can do much more, but this works for me on my projects. The rest of the settings are default settings.
<system.webServer>
<defaultDocument>
<files>
<remove value="iisstart.htm"/>
<remove value="index.html"/>
<remove value="index.htm"/>
<remove value="Default.asp"/>
<remove value="Default.htm"/>
<add value="index.aspx"/>
</files>
</defaultDocument>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="52428800"/>
</requestFiltering>
</security>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>
I don't know of too many people that use the feature in question. But you have to have the IIS 6 metabase compatibility turned on for Windows Vista, 7 and 8 in order for it to work I think.
http://www.iis.net/learn/manage/managing-your-configuration-settings/metabase-compatibility-with-iis-7-and-above[^]
|
|
|
|
|
I have a scenario where I have to create multiple sheets in excel and bind data to those sheets and download. Now I have code for creating 1 sheet. I have creatied a HTML Table and binded it to excel. In the same way I have to create multiple sheets from Html table and download the excel file.
filename = filename + " Case Study";
Query_ValuesSelection = "Select * from case_study_information where locid="+DD_Location.SelectedValue.ToString()+" and methodid="+DD_Methods.SelectedValue;
MySqlCommand command = new MySqlCommand(Query_ValuesSelection, con);
datareader = command.ExecuteReader();
if (datareader.HasRows)
{
datareader.Read();
sb.Append("<table class='Tickets'>");
//sb.Append("<tr style='color:white'>");
//sb.Append("<td style='background-color:#3a4f63' colspan=" + datareader.FieldCount.ToString() + "><b>" + DD_Location.SelectedItem.Text.ToString() + "</b></td>");
//sb.Append("</tr>");
datareader.Read();
for (int colCount = 0; colCount < datareader.FieldCount; colCount++)
{
string str = datareader.GetName(colCount).ToString();
if (datareader.GetName(colCount).ToString() == "Sample Photo")
{
sb.Append("<tr height='150'>");
sb.Append("<td><b>" + str + "</b></td>");
string filepath = Server.MapPath("Images//Case Studies//" + DD_Location.SelectedItem.Text.ToString() + ".png");
// sb.Append("<td><img src='http://localhost:53340/Retrospective/Images/epa.jpg'/></td>");
sb.Append("<td><img src='" + filepath + "'/></td>");
}
else
{
if (datareader.GetName(colCount).ToString() != "locid" && datareader.GetName(colCount).ToString() != "MethodId")
{
sb.Append("<tr>");
sb.Append("<td><b>" + str + "</b></td>");
sb.Append("<td><b>" + datareader[colCount].ToString().Trim() + "</b></td>");
}
}
sb.Append("</tr>");
}
sb.Append("</table>");
}
else
Response.Write(@"<script language='javascript'>alert('No Case Study Information for the selected location')</script>");
}
System.Text.StringBuilder sb1 = new System.Text.StringBuilder();
sb1 = sb;
if (datareader.HasRows)
{
HttpContext.Current.Response.ContentType = "Application/x-msexcel";
HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=\"" + filename + ".xls" + "\"");
HttpContext.Current.Response.Write("<html xmlns:x=\"urn:schemas-microsoft-com:office:excel\">");
HttpContext.Current.Response.Write("<head>");
HttpContext.Current.Response.Write("<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>");
HttpContext.Current.Response.Write("<!--[if gte mso 9]><xml>");
HttpContext.Current.Response.Write("<x:ExcelWorkbook>");
HttpContext.Current.Response.Write("<x:ExcelWorksheets>");
HttpContext.Current.Response.Write("<x:ExcelWorksheet>");
HttpContext.Current.Response.Write("<x:Name>" + filename + "</x:Name>");
HttpContext.Current.Response.Write("<x:WorksheetOptions>");
HttpContext.Current.Response.Write("<x:Print>");
HttpContext.Current.Response.Write("<x:ValidPrinterInfo/>");
HttpContext.Current.Response.Write("</x:Print>");
HttpContext.Current.Response.Write("</x:WorksheetOptions>");
HttpContext.Current.Response.Write("</x:ExcelWorksheet>");
HttpContext.Current.Response.Write("</x:ExcelWorksheets>");
HttpContext.Current.Response.Write("</x:ExcelWorkbook>");
HttpContext.Current.Response.Write("</xml>");
HttpContext.Current.Response.Write("<![endif]--> ");
HttpContext.Current.Response.Write("</head>");
HttpContext.Current.Response.Write("<body>");
HttpContext.Current.Response.Write(sb.ToString());
//HttpContext.Current.Response.Write(sb1.ToString());
HttpContext.Current.Response.Write("</body>");
HttpContext.Current.Response.Write("</html>");
HttpContext.Current.Response.Write("<body>");
HttpContext.Current.Response.Write(sb.ToString());
//HttpContext.Current.Response.Write(sb1.ToString());
HttpContext.Current.Response.Write("</body>");
HttpContext.Current.Response.Write("</html>");
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
|
|
|
|
|
I was purchased web hosting space and after purchased web domain. That day I am hosted a website on my space. But my major problem is the gprs data logger send the data on my IP address. But I don't know how I can read the data and save my file on every 5 minutes.
please help me how I can do this
muruga
|
|
|
|
|
|
how to run event of asp contol by javascript code?
|
|
|
|
|
|
Hello Friends, I am newer to this site
|
|
|
|
|
Welcome!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
|
Hi,,
I am getting error while using Report Viewer in VS 2005. earlier it was working fine. but it is giving error since when i installed VS2010.
But i am working on VS2005.
---------------------
Failed to map the path '/'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Failed to map the path '/'.
Source Error:
[No relevant source lines]
Source File: c:\Users\RAVIN\AppData\Local\Temp\Temporary ASP.NET Files\dindi\2fc8545a\e6dba941\App_Web_z_wzhh2b.4.cs Line: 0
------------------
Note: I found one solution from Internet that if i run the VS2005 as administration then it is working fine. But i don't want to run VS as Administrator.
Please provide me any solution.. thanks in advance.
|
|
|
|
|
Ravindra Bisen wrote: if i run the VS2005 as administration then it is working fine. But i don't want to run VS as Administrator. You need to. For it to have access to all it needs, you need to do this.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Greetings Experts,
For the past two days now, I have been struggling with this code.
Our users had just finished using our online app to cast ballots and I have been trying to accomplish three things at same time.
One, display each candidate's name, his/her total vote count, and percentage of the vote s/he received.
With the code below, I am able to successfully display candidate's name and the total vote count for each candidate.
However, I have not been able to figure out how to display the percentage of each candidate's total vote count.
In the code shown below, if I run the sql portion of the code on Sql Server Management Studio, it works great.
However, when integrated with my .net portion of the code, it keeps assigning every candidate the same percentage of 100%.
I would really appreciate your expertise on this.
Thanks a in advance for your assistance.
Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Dim questionid As Integer
questionid = CInt(CType(e.Item.FindControl("Label3"), Label).Text)
Dim cnn As New SqlConnection(ConfigurationManager.ConnectionStrings("BallotsConnectionString").ConnectionString)
Dim cmd As New SqlCommand("select CandidateId, CASE WHEN CurrentOfficeHolder='Incumbent' THEN CandidateName + ' ('+ CurrentOfficeHolder + ')' ELSE CandidateName END As CandidateName from Candidates where PositionId=@qid", cnn)
Dim p1 As New SqlParameter("@qid", questionid)
cmd.Parameters.Add(p1)
Dim da As New SqlDataAdapter
da.SelectCommand = cmd
Dim ds As New DataSet
da.Fill(ds, "choices")
cnn.Open()
For Each row As DataRow In ds.Tables("choices").Rows
Dim cmdAns As New SqlCommand("select DISTINCT " & _
"count( IsNull(er.candidateId,0)) OVER (Partition by o.orgName, p.Position, c.candidateName,p.PositionId ) " & _
"as VoteCount, " & _
"CAST(count( IsNull(er.candidateId,0)) OVER (Partition by o.orgName, p.Position, c.candidateName,p.PositionId ) *1./count( IsNull(er.candidateId,0)) OVER (Partition by p.Position)*100 as decimal(6,2)) as Percentage " & _
"from Organizations o inner join Positions p on o.OrgID = p.OrgID inner join Candidates c on p.positionId = c.positionId " & _
"inner join ElectionResults er on c.candidateId = er.candidateId " & _
"WHERE c.candidateid = @cid", cnn)
Dim pCid As New SqlParameter("@cid", row("candidateid"))
cmdAns.Parameters.Add(pCid)
Dim dr = cmdAns.ExecuteReader()
If dr.HasRows = True Then
While dr.Read
Dim count As Integer = dr(0)
Dim pct As String = dr(1)
row("CandidateName") = row("CandidateName") & " - " & count & "(" & pct & "%)"
End While
End If
dr.Close()
Next
cnn.Close()
Dim list As BulletedList = e.Item.FindControl("BulletedList1")
list.DataSource = ds
list.DataTextField = "CandidateName"
list.DataBind()
End If
End Sub
|
|
|
|
|
That's because your not calculating anything or the percentage is wrong in the database. I don't see how you can store the percentage in the database because it's always changing.
You need to get the total count of all votes and divide each candidates total votes by it
http://www.basic-mathematics.com/formula-for-percentage.html[^]
While dr.Read
Dim count As Integer = dr(0)
Dim pct As String = dr(1)
row("CandidateName") = row("CandidateName") & " - " & count & "(" & pct & "%)"
End While
|
|
|
|
|
I don't see anything on the code I posted that suggests I am storing percentages on the database.
Besides, your solution produces the same result that my produced - assigns 100% to every candidate.
|
|
|
|
|
Maybe you should post your question in the database forum, sorry but there was so much code posted, I didn't see the SQL statement.
"CAST(count( IsNull(er.candidateId,0)) OVER (Partition by o.orgName, p.Position, c.candidateName,p.PositionId ) *1./count( IsNull(er.candidateId,0)) OVER (Partition by p.Position)*100 as decimal(6,2)) as Percentage "
|
|
|
|
|
My post doesn't need to be on the database forum.
You have *not* read it either.
If you did, you would notice that I indicated that the SQL portion of the code is *not* the problem because if I run just the SQL in SSMS, it works just fine.
Integrating it with my .net code is the problem.
That's why I posted it where I did.
|
|
|
|
|
I'm in So Cal and were having that heat wave here. Guess it's getting to my brain. 3 days of 100+ weather near the coast is taking it's toll on me.
All I can suggest it running it with the debugger and a watch to pct and see if the value changes. technically, the Dim pct should create a new version in the loop, but I've never used it like that myself. Perhaps declare it earlier and ReDim pct or just use the same pct if its a number.
|
|
|
|
|
I am very very new to ASP.NET and am wondering how to use paging in a Gridview, or the equivalent, with dynamic data. I have a GridView populated with data returned from a stored procedure. The first page of data results is correct but when I try to page to the next page of results it takes me to the first 10 records in the table I am querying, with out the where clause. What am I missing? I assume I need to create the results in a certain ADO object, or other ASP.NET object, that is read and set as a table or view but I do not know what to use. I just need to be pointed in the right direction.
Thanks
Grajek
|
|
|
|
|